J-ASP provides an ADO (ActiveX Data Object) interface that allows you to access database through JDBC Driver. Use the following syntax to set the ConnectionString.
Driver=drivername;URL={JDBC url};UserID=userid;Password=password;
URL - a database url of the form jdbc:subprotocol:subname
UserID - the database user on whose behalf the connection is being made
Password - the user's password
For example: If you use Oracle JDBC driver, you can change your asp connection string as following codes:
<% |
For example:
<% |
Using JDBC-ODBC bridge driver to access database:
DSN=Data Source Name;UID=userid;PWD=password
If you have created the JNDI name in your webserver, J-ASP can call the Data Source directly. You may change the connection string to the following format:
"DSN=JNDI-NAME;UID=UserName;PWD=Password"
For more information, please see Connection Pooling.
<% |
Note: You must set the JDBC driver to the CLASSPATH. J-ASP ADO only supports the JDBC2.0 or later. If you are using the JDBC1.x driver, J-ASP ADO will be not functional.