DatabaseLink`
DatabaseLink`
JDBC
JDBC[configname, url]
generates an object for making connections to database using a named configuration from configname and url.
JDBC[classname, url]
generates an object for making connections to database with given
JDBC
driver
classname
and
url
.
Details and Options
- Typically, the first argument to JDBC is a named configuration or driver class name, and the second argument is a filename or connection URL.
- A named configuration is created as a .m file in DatabaseResources.
- A JDBC driver class name can be found in the driver's named configuration file.
- To use JDBC, you first need to load DatabaseLink using Needs["DatabaseLink`"].
Examples
Basic Examples (1)
If you find that the examples in this section do not work as shown, you may need to install or restore the example database with the "DatabaseLink`DatabaseExamples`" package, as described in Using the Example Databases.
Open a connection using the built-in JDBC configuration "HSQL(Standalone)":
The connection protocol for this database type is specified in the driver documentation and is reflected in the JDBC configuration file. Alternatively, connect to the same resource using the driver class name and an explicit connection URL: