MATLAB DATABASE TOOLBOX RELEASE NOTES Guide de l'utilisateur Page 379

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 684
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 378
Using Driver Functions
6-37
Using Driver Functions
This example uses the following Database Toolbox functions to create driver and
drivermanager objects, and to get and set their properties:
driver
drivermanager
get
isdriver
set
Note There is no equivalent MATLAB example available because this example relies on
a specific system-to-JDBC connection and database. Your configuration is different from
the one in this example, so you cannot run these examples exactly as written. Instead,
substitute appropriate values for your own system. See your database administrator for
details.
1
Connect to the database.
c = database('orc1','scott','tiger',...
'oracle.jdbc.driver.OracleDriver',...
'jdbc:oracle:thin:@144.212.123.24:1822:');
2
Use the driver function to construct a driver object and return its handle, for a
specified database URL string of the form jdbc:subprotocol:subname.
d = driver('jdbc:oracle:thin:@144.212.123.24:1822:')
DriverHandle: [1x1 oracle.jdbc.driver.OracleDriver]
3
Use the get function to get information, such as version data, for the driver object.
v = get(d)
v =
MajorVersion: 1
MinorVersion: 0
4
Use isdriver to verify that d is a valid JDBC driver object.
isdriver(d)
ans =
1
Vue de la page 378
1 2 ... 374 375 376 377 378 379 380 381 382 383 384 ... 683 684

Commentaires sur ces manuels

Pas de commentaire