JavaXT

JavaXT Connection Strings

Connection strings are URLs that encapsulate all the information required to establish a connection to a database (e.g. host, database name, username, password, driver, etc). All connection URLs have the following form:

 jdbc:[dbVendor]://[dbName][propertyList] 
Example:
jdbc:sqlserver://localhost;database=Northwind;user=sa;password=MyPassword

Connecting to a Database

Here's an example of how to connect to a Microsoft SQL Server database using a JavaXT connection string.

     javaxt.sql.Connection conn = new javaxt.sql.Connection();     
     conn.open("jdbc:sqlserver://localhost;database=Northwind;user=sa;password=MyPassword");
     conn.close();

URL Protocol

Note that JavaXT connection strings differ slightly from the JDBC connection strings published by database vendors. The key difference lies in the protocol of the URL. The JavaXT library simplifies the protocol to help determine which driver to use.

Vendor Driver Protocol
SQLServer com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver
DB2 com.ibm.db2.jcc.DB2Driver jdbc:db2
Sybase com.sybase.jdbc3.jdbc.SybDriver jdbc:sybase
PostgreSQL org.postgresql.Driver jdbc:postgresql
Derby org.apache.derby.jdbc.EmbeddedDriver jdbc:derby
SQLite org.sqlite.JDBC jdbc:sqlite
Microsoft Access sun.jdbc.odbc.JdbcOdbcDriver jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)}
FrontBase com.frontbase.jdbc.FBJDriver jdbc:FrontBase
Informix com.informix.jdbc.IfxDriver jdbc:informix-sqli
Cache com.intersys.jdbc.CacheDriver jdbc:Cache
microsoft com.microsoft.jdbc.sqlserver.SQLServerDriver jdbc:microsoft
Mimer com.mimer.jdbc.Driver jdbc:mimer
MySQL com.mysql.jdbc.Driver jdbc:mysql
Teradata com.ncr.teradata.TeraDriver jdbc:teradata
Pervasive com.pervasive.jdbc.v2.Driver jdbc:pervasive
Pointbase com.pointbase.jdbc.jdbcUniversalDriver jdbc:pointbase
pointbase microcom.pointbase.me.jdbc.jdbcDriver jdbc:pointbase:micro
Daffodil in.co.daffodil.db.jdbc.DaffodilDBDriver jdbc:daffodil
daffodilDB in.co.daffodil.db.rmi.RmiDaffodilDBDriver jdbc:daffodilDB
JTDS net.sourceforge.jtds.jdbc.Driver jdbc:jtds
Oracle oracle.jdbc.driver.OracleDriver jdbc:oracle
derby net org.apache.derby.jdbc.ClientDriver jdbc:derby:net
Firebird org.firebirdsql.jdbc.FBDriver jdbc:firebirdsql
H2 org.h2.Driver jdbc:h2
HyperSQL org.hsqldb.jdbcDriver jdbc:hsqldb
odbc sun.jdbc.odbc.JdbcOdbcDriver jdbc:odbc