Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Java Database Connectivity Drivers
Java Database Connectivity
Java Database Connectivity [JDBC] is the Java method for implementing database independent and platform independent database connectivity. Java defines a programming interface for interacting with an SQL database. Database vendors provide Java objects (usually in the form of a .jar file) that implement the programming interface on top of their databases. The collection of these objects is referred to as a Driver. These drivers are loaded by Java and then connections to the database can be made.
The Database package is built on top of JDBC; therefore to use Database, a JDBC driver must be available. Most database vendors provide JDBC drivers by either shipping them with the database software or providing downloads from their Web site. If vendor-supplied JDBC Drivers are unavailable (or are poorly implemented) there are third party JDBC drivers available as well (both commercial and otherwise).
Before trying to run Database, you must know three pieces of information about the JDBC Driver.
The location of the JDBC Driver (usually in the form of a .jar file). This needs be specified in the call to LoadDriver or added to the CLASSPATH environment variable. This is required so the Driver can be loaded.
The fully qualified package name of the Driver class (for example, com.mysql.jdbc3.Driver or org.postgresql.Driver). This is generally available in the JDBC Driver's documentation. Database does know some common JDBC Driver names; however, if it does not know the particular Driver in use or in case of conflict between installed drivers, this can be passed into LoadDriver.
The URL used to specify a database connection. This is used by OpenConnection. The URL must be of the form "jdbc:subprot:dblocation". subprot is a JDBC Driver specific sub-protocol and dblocation specifies the location of the database. The correct format for subprot and dblocation depends on the JDBC Driver, and is generally available in its documentation.
For a list of known issues and workarounds for various databases and JDBC drivers, see the issues page.
Examples
Load a JDBC driver by specifying the driver and classpath.
Open a different driver.
Open a connection using the first driver. Notice the sub-protocol name and database location.
Open another connection using the second driver.
See Also
Database, Database[compatibility], Database[Driver], Database[Driver][OpenConnection], Database[issues], Database[LoadDriver], Database[usage]
Download Help Document