HOWTO: Configure the MySQL JDBC driver for SJSAS PE 8.2
(TEST Environment)




This step assumes that you have successfully installed the MySQL database, JDK5 and the Sun Application Server. If not, please finish that before continuing with this step.

The StrongKey distribution includes the MySQL Connector/J (version 3.1.1x), distributed under the GPL. You will need to copy and configure this for the Application Server.




1

Download the StrongKey binaries from www.strongkey.org, and store them in a temporary location.

2

Verify the integrity of the download by checking the MD5 or SHA1 message digest value of the downloaded binary against the value on the website, to ensure they match; use the following on Linux

md5sum strongkey-rc-build-xxx.zip

or

sha1sum strongkey-rc-build-xxx.zip

3

In a shell (terminal) window, change directory to the /usr/tmp directory and create the symkey directory using:

mkdir symkey

4

Unzip the StrongKey distribution using the following command on Linux:

unzip strongkey-rc-build-xxx.zip

Windows users should use Windows Explorer to double-click the zip file. This will start the Unzip wizard. All files should be extracted to the c:\usr\tmp\symkey directory.

5

From the /usr/tmp/symkey directory, locate and unzip the skcl.zip file to the /usr/local/etc/symkey directory.



You should see a list of directories and files being created. Verify that the skcl directory is directly beneath /usr/local/etc/symkey. If not, redo steps 1-2 in the correct location.

6

Copy the JDBC JAR file mysql-connector-java-3.1.1x-bin.jar from the /usr/local/etc/symkey/skcl/lib directory into the /usr/local/sjsas82/lib directory as follow (on Linux):

cp mysql-connector-java-3.1.12-bin.jar /usr/local/sjsas82/lib

Bear in mind that the actual version of the JDBC jar file may be different from the 3.1.12 shown here in this documentation. Just substitute your included version in the command.

7

Startup a browser window, and type in http://localhost:4848 in the browser's address bar.

You will see a login screen for the Application Server. If you don't see it, it may be because the Application Server is not running. If so, start it using:

/usr/local/sjsas82/bin/asadmin start-domain domain1





8

Log into the Admin Server using the Admin ID and password you chose during the Application Server's installation.

If your ID and password were correct, you will see the Application Server's administrative console.





9

Click on JDBC in the left-hand pane of the Admin Server.

You should see two options presented: JDBC Resources and Connection Pools





10

Click on Connection Pools. You should see the following:





11

Click on the New... button to define a new JDBC Connection Pool. You should see a form to create a New JDBC Connection Pool





12

In the field marked Name, type the value: mysqlConnectionPool

13

In the field marked Resource Type, select the value: javax.sql.DataSource

14

In the field marked Database Vendor, select the value: mysql

Your screen should like the following:





15

Click on the Next button. You should see the following:





16

In the field marked Datasource Classname, type in the value: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource

17

Click on the Next button. You should see the following form:





18

Scroll down to the bottom of the form till you see the Properties section (it looks something like the following screen):





19

In the Properties section of the form, type in the following values. Ignore any other field if the section shows you more than these properties:



In the field marked databaseName, type in the value: symkey



In the field marked serverName, type in the value: localhost



In the field marked port, type in the value: 3306



In the field marked user, type in the value: symkey



In the field marked password, type in the password that you used to create the STRONGKEY user when installing the MySQL database. It should be symkey if you used our suggestion for the TEST environment.



If you see a field marked URL, type in the value: jdbc:mysql://localhost:3306/symkey



Type in the same value if you see a field marked Url. Note that this is different from the earlier URL in that it is mixed-case, whereas the earlier URL is in uppercase.

You can ignore all other property values. Your finished form should look something like the following:





20

Scroll to the bottom of the form and click on the Finish button.

You should see the form save the data and create the mysqlConnectionPool Connection pool





21

Click on the Persistence Managers item on the left-hand pane of the Admin Console. You should see the following:





22

Click on the New... button to define a new Persistence Manager

You should see a form to create a new Persistence Manager





23

In the field marked JNDI Name, type in the value: jdbc/mysql

24

In the field marked Connection Pool, select mysqlConnectionPool from the list.

Your form should look like the following:





25

Click OK at the top of the form. You should see the form save the data and create the jdbc/mysql Manager, as follows:





26

Click on the Application Server item on the left-hand pane of the Admin Console. You should see the General settings of the Application Server instance show up on the browser as follows:





27

Click on the JVM Settings tab, and then the Path Settings sub-menu option. You should see a form for various paths for the JVM on the browser





28

In the text field marked Classpath Prefix, go to the end of the existing text, if any, and press the Enter key. In the new line that gets created, add the following line



${com.sun.aas.installRoot}/lib/mysql-connector-java-3.1.12-bin.jar



Please be aware that this is all a single, unbroken line and that the parentheses surrounding com.sun.aas.installRoot are not regular parentheses, but curly braces.

Your form should look like the following:





29

Click on the Save button. You should see the following successful message:





30

From a terminal window restart the Application Server by first using

/usr/local/sjsas82/bin/asadmin stop-domain domain1

and then using

/usr/local/sjsas82/bin/asadmin start-domain domain1

31

Log back into the Admin Console using a browser to the http://localhost:4848 address.

32

Select JDBC on the left-side of the Admin Console.

33

Select Connection Pools from the displayed options.

34

Select mysqlConnectionPool from the list of displayed connection pools. You should see this form:





35

Click on the Ping option of the form. You should see a message at the top that says Ping was successful.





36

You have successfully configured the Application Server to use the MySQL relational database.