Search code examples
tomcatmigrationweblogicweblogic-10.x

Specifying resource when migrating from Tomcat to Weblogic 10.3


We are trying to migrate from Tomcat 6.0 to Weblogic 10.3. In the Tomcat server directory, .../conf/context.xml we have specified something like this:

<Resource name="jdbc/MSSQL1" auth="Container"
              type="javax.sql.DataSource"
              driverClassName="net.sourceforge.jtds.jdbc.Driver"
   url="jdbc:jtds:sqlserver://mssql1.dev.abc.xyz.com/db_name"
              username="usr" password="pwd$"
              initialSize="10" maxActive="10" maxIdle="10"
maxWait="-1"/>

I suppose we have to add something similar to the Weblogic server as well. But I am not sure where/in which file we have to do so. Can anyone please help me with this?

I am completely new to the Weblogic 10.3, have never used this or any of its previous versions before. So please pardon me if I am asking a very basic question.


Solution

  • A little research helped.

    On the Weblogic Admin Console:

    Services->Data Sources

    • New Data Sources, in my case 'Generic Data Source'
    • Specify any name, then a JNDI name and select Database Type, in my case MS SQL Server
    • Next, select appropriate driver Standard drivers provided by Weblogic:
    • XA: weblogic.jdbcx.sqlserver.SQLServerDataSource
    • Non-XA: weblogic.jdbc.sqlserver.SQLServerDriver If you using transaction, use 1 otherwise use 2 Click Next, Next
    • Define Connection Properties.
    • Do Test Connection

    Done!