Server.xml configuration about Tomcat5 in JSP + STRUTS + Hibernate + MSSQLServer project

xiaoxiao2021-03-06  57

I have searched online online, I have been discovered that JSP SQLSERVER2000 project development is relatively small, and Server.xml is configured in Tomcat5, because Tomcat Related Website has a large number of mysql and oracle configuration examples, there are few Sql Server example.

Today I will share the experience of my research. This is deployed on Linux. This article tells everyone how to configure server.xml, enable you to read the SQL Server database smoothly, other related struts, Hibernate how to use, please see the information about the relevant website.

First go to the Microsoft website to download the Java patch package of SQLServer, and copy the three files of the msqlser.jar msbase.jar msutil.jar to the web-lib / lib directory and then configure server.xml, as follows :( Please note that the Chinese inside will be changed to you need)

factory org.apache.catalina.users.MemoryUserDatabaseFactory pathname conf / tomcat-users.xml < Host Name = "Here the domain name, such as" debus = "0" appbase = "in www.abc.com

Write the absolute path of the web directory / OPT / Tomcat / WebApps / Abc "unpackwars =" true "autodeploy =" true "> Factory com.microsoft.jdbcx.sqlserver.sqlserverDataSourceFactory

driverclassname com.microsoft.jdbcx.sqlserver.sqlserverDataSource drivername SQLServer description SQL Server DataSource servername Here you write server IP address portnumber Write the SQLServer port number, generally writing: 1433 SelectMethod CURSOR DatabaseName Look at the database name used by SQL Server User < / Name> Write the username in the SQLServer database, you must read and write access rights to the relevant database password Write password < / value> logintimeout 3000 maxwait 3000 Maxidle 100 maxactive 10 < / Context>

The following can be written to a secondary website and read another database. www.spitrade.com

Then configure hibernate.cfg.xml (see below): Note Java: Comp / Env / JDBC / News is consistent with the resourceParams parameters of JNDI in Server.xml.

Java: comp / env / jdbc / news true net.sf.hibernate. Diagect.sqlserverDiaLect

Ok, basically configured successfully. If there is any problem, please discuss it.

转载请注明原文地址:https://www.9cbs.com/read-112843.html

New Post(0)