0% found this document useful (0 votes)
4 views

Advance Java

Uploaded by

Abhijeet Gidda
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Advance Java

Uploaded by

Abhijeet Gidda
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

JDBC- Java Database Connection

 It is an API which is used to connect java application to any relational


database
How to connect Java Application with Database
OR
Steps to connect Java Application to Database
 Load/Register database driver software
 Create the connection by url, username, password
 Create statement by Statement(I)/prepared statement/callable statement(I)
Interface
 Execute query by execute (String)/execute Update (String)/execute Query
(String) Method
 Close the created connection
What is Driver Software
 It is Jar file/ executable file which works as a translator between database
and java application
https://mnvrepository.com/
Load
try
{
class name(“conn.mysql.cj.jdbc.driver”);
}
catch (ClassNotFoundException)
{
System.out.println(“File Found”);
}
}
Create Connection
getConnection(“url, username, password”)
string url=”jdbc:mysql: //localhost/port number/ database name

You might also like