Search code examples
javatomcatwebspherewebsphere-8application-server

Migration of Tomcat database setting to Websphere


I'd like to migrate my java app, which runs locally on Tomcat 6 to Websphere 8.5. The application is deployed on Websphere without any obstacles, nevertheless it won't connect to a database during the startup. I assume that it's because I have to specify the connection info, as well as I did for Tomcat, in the context.xml file, placed to my tomcat folder:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    <Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver"
        name="jdbc/mydb" password="somepassword" type="javax.sql.DataSource"
        url="jdbc:oracle:thin:@123.456.7.89:1521/mynode" username="myusername" />
</Context>

Is my assumption correct? How to pass this information to my Websphere 8.5 AS?


Solution

  • You'll need to configure a JDBC Provider and Data Source in WebSphere just like is done in the <Resource> tag of Tomcat's context.xml.

    In WebSphere Traditional 8.5.5.x using the administrative console, this is described here.

    If you were on WebSphere Liberty, this would be done using the server.xml, as described here.