What is the normal procedure followed by a java client to access the db.?

The database connection is created in 3 steps:
Find a proper database URL
Load the database driver
Ask the Java DriverManager class to open a connection to your database
In java code, the steps are realized in code as follows:
Create a properly formatted JDBR URL for your database. (See FAQ on JDBC URL for more information). A JDBC URL has the form
jdbc:someSubProtocol://myDatabaseServer/theDatabaseName
Class.forName(”my.database.driver”);
Connection conn = DriverManager.getConnection(”a.JDBC.URL”, “databaseLogin”,”databasePassword”);
 

Search Topics

Popular Posts