Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:jdbc:home [2011/01/12 20:38]
els
dev:jdbc:home [2016/06/28 22:38] (current)
Line 3: Line 3:
 ====== Development:​ JDBC Interface ====== ====== Development:​ JDBC Interface ======
  
-**[[dev:​jdbc:​home|Overview]]** ​| [[dev:​jdbc:​datasources|JDBC Datasources]] ​| [[dev:​jdbc:​sample|Sample Program]] ​+**[[dev:​jdbc:​home|Overview]]** | [[dev:​jdbc:​sample|Sample ​Java Program]] ​
  
 ---- ----
Line 16: Line 16:
 The Omnidex JDBC class files are stored in a jar file named Omnidex.jar,​ which is located in the bin subdirectory of the Omnidex home directory on a Microsoft Windows computer (%OMNIDEX_HOME%/​bin/​Omnidex.jar),​ or the lib directory on a Linux computer ($OMNIDEX_HOME/​lib/​Omnidex.jar). The Omnidex JDBC class files are stored in a jar file named Omnidex.jar,​ which is located in the bin subdirectory of the Omnidex home directory on a Microsoft Windows computer (%OMNIDEX_HOME%/​bin/​Omnidex.jar),​ or the lib directory on a Linux computer ($OMNIDEX_HOME/​lib/​Omnidex.jar).
  
-The Omnidex ​JDBC classes ​and the java.sql ​classes should be imported into the Java class file.  The Omnidex JDBC driver should also be loaded and registered with java.sql.DriverManager. +JDBC classes ​require that you import ​java.sql into the Java application. ​
- +
-Both the Omnidex JDBC classes and the java.sql classes must be imported ​into the Java application. This is because the java.sql.DriverManager is used to register the Omnidex JDBC driver and all objects returned are from the java.sql package.+
  
   import java.sql.*;   import java.sql.*;
-  import omnidex.jdbc.*;​ 
  
-The following code snippet will load the Omnidex JDBC driver ​and register ​it with the java.sql.DriverManager. This ensures that the Omnidex JDBC driver will be used for all subsequent connections.+The Omnidex JDBC driver ​requires that you load it using the following statement
  
   Class.forName("​omnidex.jdbc.OdxJDBCDriver"​);​   Class.forName("​omnidex.jdbc.OdxJDBCDriver"​);​
Line 38: Line 35:
   Connection conn =    Connection conn = 
     DriverManager.getConnection( "​jdbc:​omnidex:​simple.dsn"​);​     DriverManager.getConnection( "​jdbc:​omnidex:​simple.dsn"​);​
- 
-From the old docs: 
- 
-Pass the connection url to the DriverManager class to obtain a connection. 
- 
-  OdxJDBCConnection conn = (OdxJDBCConnection)DriverManager.getConnection( 
-  "​jdbc:​omnidex:​c:​\\odxtesting\\dsn\\odx_file_ordersffl.dsn"​);​ 
- 
-Notice that the Connection object returned by the DriverManager is being cast to an OdxJDBCConnection object. This is because the DriverManager returns a java.sql.Connection,​ not an omnidex.jdbc.OdxJDBCConnection. All of the Omnidex JDBC Driver classes implement the java.sql classes and inherit all of the constructors,​ methods and properties. The Omnidex JDBC classes also contain some additional methods a properties specific to Omnidex. 
- 
-===== Using the JDBC Interface ===== 
- 
-Connecting to an Omnidex enhanced database through the Omnidex JDBC driver is the same as connecting to any other database using any other JDBC driver, with two notable exceptions: 
- 
-  * The Omnidex JDBC driver must be loaded and registered with java.sql.DriverManager. ​ 
-  * The connection url must point to an Omnidex Generic data source. ​ 
- 
-The java.sql classes must be imported into the Java program along with any other desired Java packages. This is because the java.sql.DriverManager is used to register the Omnidex JDBC driver. Also, the Omnidex JDBC classes throw java.sql.SQLExceptions. 
- 
-  import java.sql.*; 
- 
-The following code snippet will load the Omnidex JDBC driver and register it with the java.sql.DriverManager. This ensures that the Omnidex JDBC driver will be used for all subsequent connections. 
- 
-<​code>​ 
-Class.forName("​omnidex.jdbc.OdxJDBCDriver"​);​ 
-// Pass the connection url to the DriverManager class to obtain a connection. 
-Connection conn = DriverManager.getConnection( 
-"​jdbc:​omnidex:​c:​\\odxtesting\\dsn\\odx_file_ordersffl.dsn"​);​ 
-</​code>​ 
- 
-All of the Omnidex JDBC Driver classes implement the java.sql classes and inherit all of the constructors,​ methods and properties. The Omnidex JDBC classes also contain some additional methods and properties specific to Omnidex. 
  
  
 =====  ===== =====  =====
  
-**[[dev:​jdbc:​datasources|Next]]** ​+**[[dev:​jdbc:​sample|Next]]** ​
  
 ====== Additional Resources ====== ====== Additional Resources ======
Line 79: Line 45:
 See also:  See also: 
  
 +  * [[dev:​odbc:​filedsn| ODBC File DSN Syntax Specification]]
 {{page>:​dev:​see_also&​nofooter&​noeditbtn}} {{page>:​dev:​see_also&​nofooter&​noeditbtn}}
  
 {{page>:​bottom_add&​nofooter&​noeditbtn}} {{page>:​bottom_add&​nofooter&​noeditbtn}}
  
 
Back to top
dev/jdbc/home.1294864700.txt.gz · Last modified: 2016/06/28 22:38 (external edit)