apapanic
asked on
JSP, Tomcat web.xml file for connection to a SQL Server 2000 Database.
Hi I have an issue with a web application that is currently running on Tomcat Server 5.0.27. I have this web.xml file that connects to the database and I need the proper syntax to add to the web.xml page. This could be a question for SQL Server 2000, as well.
I have the 3 .jar files for the JDBC driver from Microsoft (msbase.jar, mssqlserver.jar, msutil.jar) and I had this connection working previously, but I lost the syntax somehow working back and fourth with Access and SQL.
I have my JSP, and Servlets correctly put together, but I need the web.xml file to list the driver, name of the database, username, password, etc. If someone knows the answer, please make sure it fits into this code from my web.xml file. The name of the database is "Data9000SQL" that sits on MS SQL Server 2000. Again, I have all 3 .jar files, they are in the correct path, and I just need to change it from the access, which i have now, to the MS SQL Server 2000.
Here is my web.xml file code...................... I need to incorporate MS SQL Server 2k, instead of access which i already have.....
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>bah.arl.eval uations.se rvlet.Subm itServlet< /servlet-n ame>
<servlet-class>bah.arl.eva luations.s ervlet.Sub mitServlet </servlet- class>
</servlet>
<servlet-mapping>
<servlet-name>bah.arl.eval uations.se rvlet.Subm itServlet< /servlet-n ame>
<url-pattern>/evaluations. jsp</url-p attern>
</servlet-mapping>
<servlet>
<servlet-name>bah.arl.eval uations.se rvlet.Resu ltServlet< /servlet-n ame>
<servlet-class>bah.arl.eva luations.s ervlet.Res ultServlet </servlet- class>
</servlet>
<servlet-mapping>
<servlet-name>bah.arl.eval uations.se rvlet.Resu ltServlet< /servlet-n ame>
<url-pattern>/results.jsp< /url-patte rn>
</servlet-mapping>
<description>
Welcome to Evaluations
</description>
<display-name>Welcome to Evaluations</display-name>
<!-- JSPC servlet mappings start -->
<context-param>
<param-name>abc</param-nam e>
<param-value>sun.jdbc.odbc .JdbcOdbcD river</par am-value>
</context-param>
<context-param>
<param-name>dbName</param- name>
<param-value>jdbc:odbc:Dri ver={Micro soft Access Driver (*.mdb)};DBQ=C:\\projects\ \evaluatio ns\\db\\Da ta9000_Acc ess</param -value>
</context-param>
<!-- JSPC servlet mappings end -->
</web-app>
I have the 3 .jar files for the JDBC driver from Microsoft (msbase.jar, mssqlserver.jar, msutil.jar) and I had this connection working previously, but I lost the syntax somehow working back and fourth with Access and SQL.
I have my JSP, and Servlets correctly put together, but I need the web.xml file to list the driver, name of the database, username, password, etc. If someone knows the answer, please make sure it fits into this code from my web.xml file. The name of the database is "Data9000SQL" that sits on MS SQL Server 2000. Again, I have all 3 .jar files, they are in the correct path, and I just need to change it from the access, which i have now, to the MS SQL Server 2000.
Here is my web.xml file code......................
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>bah.arl.eval
<servlet-class>bah.arl.eva
</servlet>
<servlet-mapping>
<servlet-name>bah.arl.eval
<url-pattern>/evaluations.
</servlet-mapping>
<servlet>
<servlet-name>bah.arl.eval
<servlet-class>bah.arl.eva
</servlet>
<servlet-mapping>
<servlet-name>bah.arl.eval
<url-pattern>/results.jsp<
</servlet-mapping>
<description>
Welcome to Evaluations
</description>
<display-name>Welcome to Evaluations</display-name>
<!-- JSPC servlet mappings start -->
<context-param>
<param-name>abc</param-nam
<param-value>sun.jdbc.odbc
</context-param>
<context-param>
<param-name>dbName</param-
<param-value>jdbc:odbc:Dri
</context-param>
<!-- JSPC servlet mappings end -->
</web-app>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.