About Using JNDI to configure DataSource (Tomcat4, JBuilder9-x)

xiaoxiao2021-03-06  41

Recently I have a project to use the Datasource in Tomcat, because you want to start Tomcat in JBuilder, configure this is a problem, because when you build a project, some configuration files will be generated in the running period; for example: new project TestDemo, will start Tomcat / Conf / Generation Server808x.xml temporary file (depending on the port different) when starting Tomcat, and generates JB - TestDemo.xml temporary files in Tomcat / WebApp / under the project directory ( Of course, based on the project name), and load these two files, also load Tomcat / WebApp / JB - Default.xml in an engineering directory. Your configuration option must be written in a Server808x.xml file; automatically generate as follows: Server8080.xml:

The document is written very well, you have to configure it manually, please delete the comment can be used (this is not automatically generated, nor will it be deleted), now we have to write the configuration parameters to this: Write a good file as follows:

factory org.apache.commons.dbcp.basicdataasourcefactory driverclassname com.microsoft.jdbc.sqlserver . SQLServerDriver URL jdbc: Microsoft: SQLServer: //192.9.100.252: 1433; DatabaseName = Achievement < Parameter > Username sa password sa Maxactive <

Value> 30 maxidle 10 maxwait 10000 10000 / value> then saved, run in JBuilder, you can use JNDI to find DataSource! ! ! !

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

New Post(0)