java.sql
Interface Driver
public interface Driver
{
}
• This interface is used to define the methods
which must be implemented by JDBC Driver
• The interface that every driver class must
implement.
• Each driver should supply a class that
implements the Driver int...
Connect()
• Connection connect(String url, Properties info) throws
SQLException
• Attempts to make a database connection t...
getConnection ( )
• Driver.getConnection ( ) :
• This is used to built connection between url and database.
• In case ther...
Upcoming SlideShare
Loading in …5
×

Driver

298 views

Published on

http://rajjdbc.blogspot.in/

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
298
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Driver

  1. 1. java.sql Interface Driver
  2. 2. public interface Driver { }
  3. 3. • This interface is used to define the methods which must be implemented by JDBC Driver
  4. 4. • The interface that every driver class must implement. • Each driver should supply a class that implements the Driver interface.
  5. 5. Connect() • Connection connect(String url, Properties info) throws SQLException • Attempts to make a database connection to the given URL. The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. This will be common, as when the JDBC driver manager is asked to connect to a given URL it passes the URL to each loaded driver in turn.The driver should throw an SQLException if it is the right driver to connect to the given URL but has trouble connecting to the database. • The java.util.Properties argument can be used to pass arbitrary string tag/value pairs as connection arguments. Normally at least "user" and "password" properties should be included in theProperties object.
  6. 6. getConnection ( ) • Driver.getConnection ( ) : • This is used to built connection between url and database. • In case there is an exception in try block, the subsequent catch block caught and handle the exception, The exception show you no suitable driver is found.

×