June 2002
Beginner to intermediate
640 pages
14h 24m
English
To start things off, we're going to create a table, insert some values, and query them.
Import the DriverManager and Class classes to load the JDBC driver.
>>> from java.sql import DriverManager >>> from java.lang import Class
Load the driver using Class.forName, which dynamically loads a class into the Java Virtual Machine (JVM). (See the Java API documentation for more details.) For Microsoft Access via ODBC (or any ODBC database):
>>> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
<jclass sun.jdbc.odbc.JdbcOdbcDriver at -416861389>
For InstantDB:
>>> Class.forName("jdbc.idbDriver")
<jclass jdbc.idbDriver at -282805662>
Just as an HTML page has an HTTP URL, so a database has a JDBC URL. The last part of the ...
Read now
Unlock full access