Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
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