NOTE:
- The instructions below apply to WebSphere Application Server 6.0.2.35 on Ubuntu 9.04, however I've also tested them successfully on in i5 WAS V6.1.0.11 Express instance - but bear in mind that some of the steps are slightly different (easier) due to the more modern version of WAS (best used via IE6 as the client IMO!)
1. Resources > JDBC Providers @ Server level (the default for all of these instructions) > New...
- For General properties I used "User-defined"
After clicking Next I provided the following details- Name = MySQL JDBC Provider
- Class path = ${USER_INSTALL_ROOT}/mysql/mysql-connector-java-5.1.8-bin.jar - this equated to /home/jsears/IBM/RAD-6.0/runtimes/base_v6/profiles/AppSrv01/mysql
- Implementation class name = com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
- Alias = MySQLUID - WAS renamed this to jsears-desktopNode01/MySQLUID
- User ID = root
- Password = mysql
3. Resources > JDBC providers > MySQL JDBC Provider > Data sources > New- Name = MySQL
- JNDI name = jdbc/MySQL
- Component-managed authentication alias =jsears-desktopNode01/MySQLUID
- databaseName = bugs - I referenced a BugZilla install on a separate server
- port = 3306
- serverName = 192.168.192.110

Statement cache size = 10 Pretest connections = ticked
- NOTE: first restart WAS!
Reference The Data Source1.
DataSource ds = (DataSource) ctx.lookup("java:comp/env/MySQLResourceReference");

I accepted all the defaults when uploading the .war - including the "Map resource references to resources" options, as I had already defined the details previously:
The URL I used, once the application was started, to invoke this servlet was: http://127.0.0.1:9081/ReferenceJNDIdataSource/ReferenceJNDIdataSource
0 comments:
Post a Comment