Download Slide 1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Serializability wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

SQL wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

IMDb wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

PL/SQL wikipedia , lookup

Oracle Database wikipedia , lookup

Functional Database Model wikipedia , lookup

Ingres (database) wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Database wikipedia , lookup

Concurrency control wikipedia , lookup

Relational model wikipedia , lookup

Versant Object Database wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

ContactPoint wikipedia , lookup

Transcript
DATABASE
CONNECTIVITY
TO MYSQL
To Connect to a relational database from
within Java Application, can be done using
JDBC API of Java. It mainly do the
following tasks.
1. Establish a connection with a database.
2. Send SQL statements to database
server.
3. Process the result obtained.
Classes Used for Database
Connectivity
Four main classes in the JDBC API that are
generally used for database connectivity.
1. DriverManager Class
2. Connection Class
3. Statement Class
4. ResultSet Class
Prerequisites for connecting to
MySQL from Java
MySQL provides connectivity for
client applications developed in
the Java programming language
via a JDBC driver, which is called
MySQL Connector/J
To check the availability
• Start NetBeans IDE
• Click Tools
Libraries
• In the Library box, look for MySQL JDBC
driver under the class Libraries.
• Note down its path
Steps for creating database
connectivity applications
• Import the packages required for database
programming
• Register the JDBC driver
• Open a connection
• Execute a Query
• Extract Data from the Result set
• Clean up the environment