Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
Database[LoadDriver] - load a Database Driver
Calling Sequence
LoadDriver(opts)
Parameters
opts
-
(optional) equations of the form option=string where option is one of driver or classpath
Description
The LoadDriver command attempts to load a Java Database Connectivity [JDBC] driver, which Maple uses to connect to a database. With no arguments, Maple tries to load a driver from a list of known drivers. It uses the current value of the CLASSPATH environment variable as the search path for the Driver. If no JDBC driver can be loaded, then an exception is raised. For more information about JDBC drivers, see JDBC.
The LoadDriver command returns a Driver module. The OpenConnection export of this module can be used to connect to the database. For an overview of using the Database package, see usage.
The LoadDriver command accepts two optional parameters that specify which driver to use.
driver = string
Specify the package name of the Java Driver class to use. This name must be available in the documentation for the JDBC driver being used. It must be similar in form to "com.vendorname.Driver". If a classpath argument is not specified it looks for this class using the CLASSPATH environment variable.
classpath = string
Specify locations to search for the JDBC Driver. The string must contain directories and .jar files in the same format as is used for the CLASSPATH variable. That is, paths delimited by kernelopts( pathsep ), where a directory path indicates to search .class file within that directory and a .jar file indicates to search .class files within that .jar file. Most JDBC drivers are shipped in the form of a .jar file. For example classpath="database/java/jdbc.jar". If you do not specify a driver argument then Maple attempts to load a Driver from a list of known drivers.
The list of known drivers used by LoadDriver is, com.mysql.jdbc.Driver (for MySQL databases), org.postgresql.Driver (for PostgreSQL databases), net.sourceforge.jtds.jdbc.Driver (for Microsoft SQL Server databases) and com.sybase.jdbc2.jdbc.SybDriver (for various Sybase databases). When no driver argument is given, Maple stops searching after the first Driver is successfully loaded. Therefore, specifying driver or classpath may be required if multiple JDBC drivers are installed.
Examples
Let Maple look for the driver.
Error, (in Database:-LoadDriver) a driver could not be loaded, please see ?Database:-LoadDriver
No valid driver found. Try specifying the classpath.
Error, (in Database:-LoadDriver) could not load driver: classpath = c:\\database\\jdbc\\driver.jar
Still no driver found. Try specifying the driver.
Error, (in Database:-LoadDriver) could not load driver: driver = com.jdbc.Driver
This time specify both.
See Also
Database, Database[Connection], Database[Driver], Database[Driver][OpenConnection], Database[JDBC], Database[usage]
Download Help Document