Differences

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

Link to this comparison view

Next revision
Previous revision
dev:jdbc:home [2009/11/19 00:38]
127.0.0.1 external edit
dev:jdbc:home [2016/06/28 22:38] (current)
Line 1: Line 1:
-====== Using the JDBC Interface ======+{{page>:​top_add&​nofooter&​noeditbtn}}
  
-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:+====== Development: ​JDBC Interface ======
  
-  ​The Omnidex JDBC driver must be loaded and registered with java.sql.DriverManager.  +**[[dev:​jdbc:​home|Overview]]** | [[dev:​jdbc:​sample|Sample Java Program]] ​
-  ​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 packagesThis is because the java.sql.DriverManager ​is used to register ​the Omnidex ​JDBC driverAlso, the Omnidex JDBC classes ​throw java.sql.SQLExceptions.+---- 
 + 
 + 
 +===== Overview ===== 
 + 
 +The Omnidex JDBC Driver is a standard-compliant JDBC driver that provides ​Java access to Omnidex Environments The Omnidex JDBC Driver ​is supported on Microsoft Windows and Linux operating systems  
 + 
 +==== The Omnidex JDBC Classes ===== 
 + 
 +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). 
 + 
 +JDBC classes ​require that you import ​java.sql ​into the Java application
  
   import java.sql.*;   import java.sql.*;
  
-The following code snippet will load the Omnidex JDBC driver ​and register ​it with the java.sql.DriverManagerThis 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"​);​ 
 + 
 +==== Connecting to an Omnidex ​Environment ==== 
 + 
 +Connecting to an Omnidex Environment File in JDBC simply requires referencing the Omnidex connection string in the call to DriverManager.getConnection:​ 
 + 
 +  Connection conn =  
 +    DriverManager.getConnection( "​jdbc:​omnidex:​[server1:​7555]C:​\\class\\simple.xml"​);​ 
 + 
 +It is also possible to reference a File DSN in the call to DriverManager.getConnection. ​ File DSN's are typically ​used with ODBC applications,​ but can be useful ​for externalizing the connection string. ​ Consult the [[dev:​odbc:​filedsn| ODBC File DSN Syntax Specification]] for instructions to build a File Datasource. 
 + 
 +  Connection conn =  
 +    DriverManager.getConnection( "​jdbc:​omnidex:​simple.dsn"​);​ 
 + 
 + 
 +=====  ===== 
 + 
 +**[[dev:​jdbc:​sample|Next]]**  
 + 
 +====== Additional Resources ====== 
 + 
 +See also: 
  
-<​code>​ +  * [[dev:odbc:filedsn| ODBC File DSN Syntax Specification]] 
-Class.forName("​omnidex.jdbc.OdxJDBCDriver"​);​ +{{page>:​dev:​see_also&​nofooter&​noeditbtn}}
-// 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.+{{page>:​bottom_add&​nofooter&​noeditbtn}}
  
 
Back to top
dev/jdbc/home.1258591125.txt.gz · Last modified: 2016/06/28 22:38 (external edit)