Link to home
Start Free TrialLog in
Avatar of kanishkpanwar
kanishkpanwar

asked on

Setup SQL server 2000 with Tomcat 5.x

Hello,

I am trying to setup a SQL server 2000 with tomcat 5.x to run a  webapp. Can anyone please tell me how to configure my server.xml, we.xml and installing SQL drivers in \lib folder of Tomcat.
I would love to have a straight forward xml snippet with directions and I will follow up on this thread if I have more doubts.

thanks,
Kanishk.
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

instead of server.xml. you should be creating a context file in conf /catalina/localhost it will look something like this

<Context path="/ACProspero" docBase="C:/Tomcat5.0/webapps/ACProspero" debug="0" reloadable="true" crossContext="true">
  <Resource name="jdbc/SQLServerSuppData" auth="Container" type="com.microsoft.jdbcx.sqlserver.SQLServerDataSource" />
 <ResourceParams name="jdbc/SQLServerSuppData">
 <parameter>
  <name>user</name>
  <value>sa</value>
  </parameter>
 <parameter>
  <name>password</name>
  <value>password</value>
  </parameter>
 <parameter>
  <name>serverName</name>
  <value>machinename</value>
  </parameter>
 <parameter>
  <name>port</name>
  <value>1433</value>
  </parameter>
 <parameter>
  <name>driverClassName</name>
  <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</value>
  </parameter>
 <parameter>
  <name>driverName</name>
  <value>SQLServer</value>
  </parameter>
 <parameter>
  <name>factory</name>
  <value>com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory</value>
  </parameter>
 <parameter>
  <name>DatabaseName</name>
  <value>AC_DEV</value>
  </parameter>
 <parameter>
  <name>url</name>
  <value>jdbc:microsoft:sqlserver</value>
  </parameter>
 <parameter>
  <name>maxActive</name>
  <value>2</value>
  </parameter>
 <parameter>
  <name>maxIdle</name>
  <value>1</value>
  </parameter>
  </ResourceParams>


after this you will have to add following in  web.xml
<resource-ref>
        <description>DataSource</description>        
        <res-ref-name>jdbc/SQLServerSuppData</res-ref-name>
             <res-type>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</res-type>        
        <res-auth>Container</res-auth>
    </resource-ref>

and you shd keep following jar file in your tomcat/lib
msutil.jar
msbase.jar
msssqlserver.jar
Avatar of kanishkpanwar
kanishkpanwar

ASKER

" instead of server.xml. you should be creating a context file in conf /catalina/localhost it will look something like this"
-- why is that?

Resource name="jdbc/SQLServerSuppData"....
what is this? Name of the Database or just a unique name given for JNDI lookup?
also,
Can you please post links to download the mentioned 3 jar files ?

thanks.
>>instead of server.xml. you should
because in tomcat 5.x you can create a separate file for each context. It helps maintaining them better the resource name is the unique name for your JNDI look up
database name goes in the parameters

as far as downloading these jars are concerned you can download them from microsoft... just google the name & it will give you the link..
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello,
Just to let you know..I have not forgotten about this thread. I am a bit busy with some other work. I'll respond in a day or 2. I am sorry for the trouble.
my system has crashed. I am arranging for a new copy of SQL SERVER. Please bear with me. thank you.
btw, I want to use j_security_check mechanism to login.
Can anyone tell me SQL server settings with respect to that?
Sadly, none of the experts answered the question I had asked. but still..I awarded points to one of the experts.