Professional Documents
Culture Documents
AIM:
Write a program in Java that enters student details (Roll No, Name etc) and retrieves information.
Use Access as a database and write the application in JDBC. (AWT or JFame)
THEORY:
JDBC stands for Java Database connectivitys. It is a software layer that allows developers to
write real client-server projects in Java. JDBC is based on the X/OPEN call level interface (CLI)
for SQL. JDBC was designed to be a very compact, simple interface focusing on the execution of
raw SQL statements and retrieving the results. The components of JDBC are Application, Driver
manager and Driver.
JDBC Vs ODBC
ODBC cannot be directly used with Java because it uses a C interface.
ODBC makes use of pointers which have been totally removed from Java.
ODBC mixes simple and advanced features together and has complex options for simple
queries.
ODBC requires manual installation of the ODBC driver manager and driver on all client
machines. JDBC drivers are written in Java and JDBC code is automatically installable, secure
and portable on all java platforms from network computers to mainframes.
The JDBC API defines a set of interfaces and classes to be used for communications with a
database. These interfaces and classes are found in the java.sql package. The results of the SQL
statements are stored in ResultSet object and getXXX method used to retrieve the data from
ResultSet. A transaction is set of one or more statements that are executed together as a unit, so
either all of the statements are executed or none of the statement is executed.
DSN: Types of DSN
File DSN Accessibility is very low
System DSN Easy to access and by all users.
User DSN Specific to a user but not portable.