tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Greene" <agre...@romulin.com>
Subject DataSources and JNDI
Date Thu, 23 May 2002 15:04:31 GMT
I'm trying to get the Microsoft SQL Driver to work in doing DataSources.  It has a class called
com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory, but I must not be getting the config
right or something because it keeps returning Nulls out of the JNDI.

server.xml:

          <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"/>
        
          <ResourceParams name="jdbc/TestDB">
            <parameter>
                <name>factory</name>
                <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory</value>
            </parameter>
            <parameter>
                <name>user</name>
                <value>sa</value>
            </parameter>
            <parameter>
                <name>password</name>
                <value><removed></value>
            </parameter>
            <parameter>
                <name>databaseName</name>
                <value>Testdatabase<value>
            </parameter>
            <parameter>
                <name>serverName</name>
                <value>myserver</value>
            </parameter>
            <parameter>
                <name>PortNumber</name>
                <value>1433</value>
            </parameter>
          </ResourceParams>

java Code:

Context ctx = new InitialContext();


DataSource ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/TestDB");



Thanks for any help you can give.

Adam Greene
Team Leader
ROMulin Group Inc
Ph:   (506) 863-1014
Fax: (506) 854-6886
http://www.romulin.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message