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
Driver:-OpenConnection - opens a connection to a database
Calling Sequence
driver:-OpenConnection(url, username, password, opts )
Parameters
driver
-
Driver module
url
string; specifying the database
username
string; username for logging into the database
password
string or name; password to for logging into the database, 'none', or 'hidden'
opts
(optional) equations of the form option=value where option is one of readonly or isolation
Description
OpenConnection opens a connection to a database using the JDBC Driver represented by driver. The argument url specifies the database. username is the name to use for logging in. If password is a string then it is used as the password when logging in. If password is none then no password is used when logging in. If password is hidden, then a Maplet application, which allows the password to be entered without it appearing on screen, is opened.
The value of url depends on the type of database, the JDBC driver and where the database is installed. However the basic format is "jdbc:driver://hostname/DBName". driver is an identifier for the JDBC driver being used. hostname is the name of the computer on which the database is installed. hostname might also include a port number if the default port is incorrect. DBName is the name of the particular database. For the correct values, consult the documentation for the JDBC driver you are using. For more information about JDBC drivers, see JDBC.
For a general overview of using Database, see the usage page.
OpenConnection accepts all the arguments that can be set on a Connection using SetOptions. The valid options are readonly and isolation.
readonly = true or false
The readonly optional argument informs the database that it can enable optimizations associated with a read-only connection. The effect depends on the database. Setting readonly=true may or may not prevent the execution of updates. By default, connections are not opened read-only.
isolation = uncommittedread, committedread, repeatableread or serializable
The isolation optional argument determines how isolated transactions using this connection are from transactions occurring at the same time.
- At serializable isolation, dirty reads (reading uncommitted data from parallel transactions), non-repeatable reads (reading the same row multiple times producing different results due to parallel updates), and phantom reads (WHERE conditions matching different numbers of rows due to parallel updates) are all prevented.
- At repeatableread isolation, dirty reads and non-repeatable reads are prevented.
- At committedread, only dirty reads are prevented.
- At uncommittedread isolation, dirty reads are also allowed.
The default isolation is database specific.
OpenConnection can be used to open multiple parallel connections to a single database or multiple connections to different databases (assuming they are all compatible with driver).
Examples
Load the JDBC driver and open a connection to the database.
Open a read-only connection to the same database.
Open a connection to a different database.
Load a driver for a different kind of database and open a connection to that database.
See Also
Database, Database[Connection], Database[Connection][SetOptions], Database[Driver], Database[JDBC], Database[usage]
Download Help Document