Q) How do I configure Instant ASP so that I can access a MySQL database server?

A) Depending upon the JDBC driver you are using, follow the steps below:

NOTE: Classpath statements and ConnectionStrings in the following examples must all be on a single line.

I. Configuring a mm.mysql.jdbc driver

If you are using the mm.mysql.jdbc driver (recommended and available from: http://www.mysql.com/Contrib/), make sure mysql_comp.jar or mysql_uncomp.jar are in a directory referenced in your Java classpath.

You can define your classpath in start-server.sh located in the root iASP installation directory as follows:

# the folder /mysql/jdbc is the location where mysql_comp.jar
# or mysql_uncomp.jar are located. The folder
# /export/home/webservers/iasp is the root folder of iASP.
# The folder /export/home/jdk/1.1/ is the root forlder of the JDK.

java -classpath /mysql/jdbc/mysql_comp.jar:
/export/home/jdk/1.1/bin/../lib/classes.zip:
/export/home/jdk/1.1/bin/../lib/rt.jar:
/export/home/webservers/iasp/lib/jsdk.jar:
/export/home/webservers/iasp/lib/iasplib.jar:
/export/home/webservers/iasp/lib/activation.jar:
/export/home/webservers/iasp/lib/mail.jar:
/export/home/webservers/iasp/lib/pop3.jar:
/export/home/webservers/iasp/lib/rjax.jar:
/export/home/webservers/iasp/lib/buttons.jar:
/export/home/webservers/iasp/lib/classes:
/export/home/webservers/iasp/lib/iasp_chart.jar:
/export/home/webservers/iasp/lib/iasp_image.jar:
/export/home/webservers/iasp/lib/iasp_mail.jar:
/export/home/webservers/iasp/lib/iasp_pop3.jar:
/export/home/webservers/iasp/lib/iasp_sock.jar:
/export/home/webservers/iasp/lib/iasp_exec.jar:
/export/home/webservers/iasp/lib/ejbcorba.jar:
/export/home/webservers/iasp/servlets -mx32768000
servlet.http.HttpServer

The prototype JDBC connection string when using a mm.mysql.jdbc driver looks like:

ConnectionString="DRIVER=org.gjt.mm.mysql.Driver;URL={jdbc:mysql://:/};
uid=MySQLUser;pwd=MySQLPassword;"
set con = Server.CreateObject("ADODB.Connection")
con.open(ConnectionString)

EXAMPLE: In the following example, the MySQL database is located at the IP 192.168.200.1 on port 3306. The userid is 'root' and the password is '1234'.

ConnectionString="DRIVER=org.gjt.mm.mysql.Driver;
URL={jdbc:mysql://192.168.200.1:3306/Test};uid=root;pwd=1234;"
set con = Server.CreateObject("ADODB.Connection")
con.open(ConnectionString)

II. Configuring a twz1jdbcForMysql driver

Make sure that either the twz1jdbcForMysql.jar or twz1jdbcForMysql.jar files are in a directory referenced in your Java classpath.

You can define your classpath in start-server.sh located in the root iASP installation directory as follows:

# the folder /mysql/jdbc is the location where
# twz1jdbcForMysql1.jar is located. The folder
# /export/home/webservers/iasp is the root folder
# of iASP. The folder /export/home/jdk/1.1/ is the
# root folder of the JDK.

java -classpath /mysql/jdbc/twz1jdbcForMysql.jar:
/export/home/jdk/1.1/bin/../lib/classes.zip:
/export/home/jdk/1.1/bin/../lib/rt.jar:
/export/home/webservers/iasp/lib/jsdk.jar:
/export/home/webservers/iasp/lib/iasplib.jar:
/export/home/webservers/iasp/lib/activation.jar:
/export/home/webservers/iasp/lib/mail.jar:
/export/home/webservers/iasp/lib/pop3.jar:
/export/home/webservers/iasp/lib/rjax.jar:
/export/home/webservers/iasp/lib/buttons.jar:
/export/home/webservers/iasp/lib/classes:
/export/home/webservers/iasp/lib/iasp_chart.jar:
/export/home/webservers/iasp/lib/iasp_image.jar:
/export/home/webservers/iasp/lib/iasp_mail.jar:
/export/home/webservers/iasp/lib/iasp_pop3.jar:
/export/home/webservers/iasp/lib/iasp_sock.jar:
/export/home/webservers/iasp/lib/iasp_exec.jar:
/export/home/webservers/iasp/lib/ejbcorba.jar:
/export/home/webservers/iasp/servlets -mx32768000
servlet.http.HttpServer

The prototype JDBC connection string when using a twz1jdbcForMysql driver looks like:

ConnectionString="DRIVER=twz1.jdbc.mysql.jdbcMysqlDriver;
URL={jdbc:z1MySQL://:/};uid=MySQLUser;pwd=MySQLPassword;"
set con = Server.CreateObject("ADODB.Connection")
con.open(ConnectionString)

EXAMPLE: In the following example, the MySQL database is located at the IP 192.168.200.1 on port 3306. The userid is 'root' and the password is '1234'.

ConnectionString="DRIVER=twz1.jdbc.mysql.jdbcMysqlDriver;
URL={jdbc:z1MySQL://192.168.200.1:3306/Test};uid=root;pwd=1234;"
set con = Server.CreateObject("ADODB.Connection")
con.open(ConnectionString)


Copyright © 1998-2002, Halcyon Software Inc. All rights reserved.