You are on page 1of 15

JAVA DATABASE CONNECTIVITY – JDBC

BY

FATIMA SUNUSI MUHAMMAD CFJ/ND/COM/2022/391

A COM211 OVERVIEW PAPER ON THE DIFFERENT KINDS OF DATA SETS THAT ARE
BEING UTILIZED IN FRAMEWORK AND PROGRAMMING IMPROVEMENT, WITH A
FOCUS ON JAVA DATABASE CONNECTIVITY(JDBC), AND ANY REMAINING DBMS
AND DATA SET DRIVERS UPHELD AND UTILIZED BY/IN JAVA.

MARCH 2024

i
TABLE OF CONTENT

1. Introduction______________________________________________________________________________1

2. Aims and Objectives_____________________________________________________________________2

3. Literature review________________________________________________________________________2

3.1. Examples of Relational Database_____________________________________________________5

3.2. Tables of Relational Database________________________________________________________6

4. Conclusion________________________________________________________________________________7

5. References________________________________________________________________________________ 7

6. The development of a registration form program_____________________________________8

ii
LIST OF FIGURE

1. Figure 1_____________________________________________________________________________ 1

2. Figure 2______________________________________________________________________________5

iii
LIST OF TABLES

1. Table 1_______________________________________________________________________________________6

2. Table 2_______________________________________________________________________________________6

iv
1. Introduction & Justification

A relational database is a type of database that stores and provides access to data

points that are related to one another. Relational databases are based on the

relational model, an intuitive, straightforward way of representing data in tables.

Relational databases play a key role in system and software development by

providing an organized method for storing and retrieving data. This research

investigates the importance of relational databases in the development process,

specifically looking at how they help maintain data integrity, scalability, and

performance. The article examines Java Database Connectivity (JDBC) and different

DBMS and database drivers that work with Java to give a thorough insight into how

relational databases are used in Java applications.

Fig.1

-1-
2. Aims and Objectives

1. To assess the significance of relational databases in the development of systems and

software.

2. To evaluate the role of Java Database Connectivity (JDBC) in Java applications.

3. To investigate the various database management systems (DBMS) and database

drivers compatible with Java.

4. To evaluate how relational databases influence data management and the

performance of applications.

5. To discuss the advantages and obstacles of using relational databases in software

development.

3. Literature Review

Social data sets have been a foundation of information the board in programming

improvement, giving an organized and effective method for putting away and recover

information (Date, 2003, p. 45). Famous social data set administration frameworks

(RDBMS) like MySQL, PostgreSQL, Prophet, and SQL Server offer vigorous elements for

dealing with complex information designs and connections. These information bases

put together information into tables with predefined outlines, authorizing information

respectability through requirements and connections.

-2-
Java Information base Network (JDBC) is a key innovation that empowers Java

applications to communicate with social data sets consistently (Elmasri and Navathe,

2016, p. 312). JDBC gives a standard Programming interface to Java engineers to

associate with various data set frameworks and execute SQL inquiries. By utilizing

JDBC drivers well defined for every data set, like MySQL Connector/J or PostgreSQL

JDBC Driver, Java applications can speak with the basic data set productively.

The MySQL Connector/J driver, created by the MySQL improvement group, is a well

known decision for incorporating Java applications with MySQL information bases

(MySQL, n.d.). This JDBC driver furnishes enhanced execution and similarity with

MySQL, permitting Java designers to use the full capacities of MySQL in their

applications. With highlights like association pooling and articulation reserving, MySQL

Connector/J improves data set availability and execution.

PostgreSQL, an open-source social data set framework, offers the PostgreSQL JDBC

Driver for Java applications to connect with PostgreSQL information bases

(PostgreSQL, n.d.). This driver empowers Java designers to execute SQL questions,

exchanges, and put away methods on PostgreSQL information bases, guaranteeing

dependable information access and control. The PostgreSQL JDBC Driver is known for

its vigor and similarity with different Java applications.

Prophet, a main supplier of big business information base arrangements, offers the

Prophet JDBC Driver for Java engineers to interface Java applications with Prophet Data

-3-
set (Prophet, n.d.). This driver upholds progressed elements of Prophet Information

base, like high accessibility, security, and adaptability. By utilizing the Prophet JDBC

Driver, Java designers can guarantee consistent incorporation with Prophet Data set

for productive information stockpiling and recovery.

Social information bases offer a few benefits, including information consistency and

trustworthiness through the implementation of connections and limitations (Reddy,

2015, p. 78). Engineers can characterize essential keys, unfamiliar keys, and

imperatives to keep up with information exactness and unwavering quality in social

data sets. Also, social data sets support complex inquiries, exchanges, and ordering

components for productive information recovery and control.

While social data sets succeed in information honesty and organized questioning, they

might confront difficulties in adaptability and execution enhancement (Date, 2003, p.

112). Huge scope applications with high information volumes and exchange rates

might experience adaptability limits in social data sets. Information base

standardization, albeit fundamental for information uprightness, can prompt complex

pattern plans that influence execution.

As of late, the ascent of NoSQL data sets has given elective answers for explicit use

situations where social information bases may not be the best fit (Elmasri and Navathe,

2016, p. 450). NoSQL information bases like MongoDB, Cassandra, and Redis offer

adaptability, versatility, and high accessibility for dealing with different information

-4-
types and volumes. These data sets are intended to address the restrictions of social

data sets in specific situations.

3.1. Examples of Relational Databases includes:

1. MySQL

2. PostgreSQL

3. Oracle Database

4. SQL Server

Fig.2 Oracle Database

-5-
3.2. Tables of Relational Data Base System

Table 1. Sample Table of Relational Data Base System

Table 2. Data Analysis in MySQL

-6-
4. Conclusion

Social data sets stay a fundamental part of framework and programming improvement,

offering an organized way to deal with information the executives. Java Data set

Availability (JDBC) and upheld DBMS and data set drivers in Java upgrade data set

association, empowering consistent correspondence with social data sets. By utilizing

the qualities of social information bases and tending to expected difficulties, engineers

can assemble productive and solid programming frameworks that meet their

information the executives needs successfully.

5. References

1. Date, C. J. (2003). *An prologue to information base systems* (eighth ed.).

Addison-Wesley.

2. Elmasri, R., and Navathe, S. B. (2016). *Fundamentals of data set systems*

(seventh ed.). Pearson.

3. MySQL. (n.d.). MySQL: The world's most well known open-source data set.

Recovered from https://www.mysql.com/

4. Prophet. (n.d.). Prophet JDBC Driver documentation. Recovered from

https://docs.oracle.com/en/data set/prophet/prophet data set/

5. PostgreSQL. (n.d.). PostgreSQL: The world's most developed open-source data

set. Recovered from https://www.postgresql.org/

6. Reddy, V. S. (2015). *Mastering Java Information base Programming*. Packt

Distributing.

-7-
7. Date, C. J. (2003). Database Systems: An Introduction. Addison-Wesley.

8. Elmasri, R., & Navathe, S. B. (2016). Fundamentals of Database Systems. Pearson.

9. Oracle Corporation. (n.d.). Java Database Connectivity (JDBC) API.

10. PostgreSQL. (n.d.). Documentation for PostgreSQL JDBC Driver.

The development of a registration form program

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.PreparedStatement;

import java.sql.SQLException;

import java.util.Scanner;

public class RegistrationForm {

public static void main(String[] args) {

try {

// Connect to the SQLite database

-8-
Connection connection =

DriverManager.getConnection("jdbc:sqlite:registration.db");

// Create a table to store user information

String createTableSQL = "CREATE TABLE IF NOT EXISTS users (" +

"id INTEGER PRIMARY KEY AUTOINCREMENT," +

"first_name TEXT," +

"last_name TEXT," +

"email TEXT," +

"password TEXT," +

"gender TEXT," +

"age INTEGER" +

")";

connection.createStatement().executeUpdate(createTableSQL);

// Collect user input

Scanner scanner = new Scanner(System.in);

System.out.println("Please enter your information:");

-9-
System.out.print("First Name: ");

String firstName = scanner.nextLine();

System.out.print("Last Name: ");

String lastName = scanner.nextLine();

System.out.print("Email Address: ");

String email = scanner.nextLine();

System.out.print("Password: ");

String password = scanner.nextLine();

System.out.print("Gender: ");

String gender = scanner.nextLine();

System.out.print("Age: ");

int age = scanner.nextInt();

// Insert user information into the database

String insertSQL = "INSERT INTO users (first_name, last_name, email,

password, gender, age) VALUES (?, ?, ?, ?, ?, ?)";

PreparedStatement preparedStatement =

connection.prepareStatement(insertSQL);

- 10 -
preparedStatement.setString(1, firstName);

preparedStatement.setString(2, lastName);

preparedStatement.setString(3, email);

preparedStatement.setString(4, password);

preparedStatement.setString(5, gender);

preparedStatement.setInt(6, age);

preparedStatement.executeUpdate();

System.out.println("User information saved successfully!");

connection.close();

} catch (SQLException e) {

e.printStackTrace();

- 11 -

You might also like