1. Upload JDBC Driver You have to make JDBC drivers (e.g. mysql-connector-java-3.0.11-stable-bin.jar) for your database available to Oracle Application Server. You have to copy those to %ORACLE_HOME%/j2ee/home/applib directory.
2. Create a Native DataSource
You can use the ASC to create a native data source as follows:
jndi-name="jdbc/MyDS"
description="Native DataSource" data-source-class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
user="user"
password="password"
url="jdbc:mysql://localhost:3306/mydatabase">
Now you should be able to access the DataSource connecting to MySQL database with a JNDI location "jdbc/MyDS".
1 comment:
Hello,
In the latest build of OC4J and Oracle AS (10.1.3.3.0, July 2008) the contents of j2ee/home/applib directory is disabled, so it's not enough to put the mysql driver jar in that directory, you also have to edit the j2ee/home/application-deployments/ascontrol/orion-application.xml file and comment out the line with following tag:
remove-inherited name="global.libraries"
For more info, check this post on the Oracle OC4J forum: http://forums.oracle.com/forums/thread.jspa?messageID=2645102
Hope this will help other people,
Wouter
Post a Comment