CST(72)-Java Database Connection (JDBC)

JDBC is a set of Java classes that provide an ODBC-like interface to SQL databases. Like ODBC, JDBC uses a driver manager to automatically load the right JDBC driver to talk to a given database.

Unlike ODBC, JDBC must pay close attention to mobile code issues. For example, a JDBC driver must prevent an untrusted applet from accessing databases outside its home machine- meaning the machine from which the applet originates. Likewise, a driver that is downloaded as an applet can only be allowed to access its home database. Of course, applets and drivers can get around these limitations by convincing the Java loader that they are trustworthy;

URL based naming scheme: jdbc:<subprotocol><domainname>. For example, the URL to access “MyJavaDB” via a JDBC-to-ODBC bridge might look like this:


In this example, the subprotocol is “odbc” and the hostname is”. You can also use this scheme to provide a level of indirection in database names. You do this specifying a naming service as the subprotocol. Here’s an example of a URL that does this:

In this example, the URL specifies that the DCE naming service is used to resolve the database name “MyJavaDB” into a global name that connects to the database. JDBC recommends that you provide a psuedo-driver that looks up names via a networked name server. It then uses the information to locate the real driver and pass it the connection information.
CST(72)-Java Database Connection (JDBC) Reviewed by 1000sourcecodes on 21:50 Rating: 5
Powered by Blogger.