1, to D:/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/docs/examples/JCA/directory find the mssql-ds.xml file, modify the parameters, including the connection name, user name, password and so on.
- <? XML version = "1.0" encoding = "UTF-8"?>
- <Datasources>
- <Local-TX-datasource>
- <JNDI-Name> jcuckoo-Ds </JNDI-Name>
- <Connection-URL> JDBC: Microsoft: sqlserver: // localhost: 1433; databasename = mydatabase </connection-URL>
- <Driver-class> com. Microsoft. sqlserver. JDBC. sqlserverdriver </driver-class>
- <User-Name> SA </user-Name>
- <Password> </password>
- <Metadata>
- <Type-mapping> MS sqlserver2000 </type-mapping>
- </Metadata>
- </Local-TX-datasource>
- </Datasources>
Then publish the data source to copy the file to the D:/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/Server/default/deploy/directory.
2, the corresponding mssql2000 driver msbase. jar, MSSQLServer. jar, msutil. Jar copy to D:/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/Server/default/lib/directory.
3. Start the JBoss server to view the data source. Open the browser and go to the JBoss console, http: // localhost: 8080/JMX-console/
The data source is found in JBoss. JCA.
Name = jcuckoo-ds, service = performancebinding
Name = jcuckoo-ds, service = localtxcm
Name = jcuckoo-ds, service = managedconnectionfactory
Name = jcuckoo-ds, service = managedconnectionpool
Click name = jcuckoo-ds, service = managedconnectionpool to connect to the console. You can reset the settings. However, the value set in this file will be lost when JBoss is restarted. If you do not want to lose it, you can modify the previous configuration file.
- <? XML version = "1.0" encoding = "UTF-8"?>
- <Datasources>
- <Local-TX-datasource>
- <JNDI-Name> jcuckoo-Ds </JNDI-Name>
- <Connection-URL> JDBC: Microsoft: sqlserver: // localhost: 1433; databasename = mydatabase </connection-URL>
- <Driver-class> com. Microsoft. sqlserver. JDBC. sqlserverdriver </driver-class>
- <User-Name> SA </user-Name>
- <Password> </password>
- <Min-pool-size> 3 </min-pool-size>
- <Max-pool-size> 30 </max-pool-size>
- <Metadata>
- <Type-mapping> MS sqlserver2000 </type-mapping>
- </Metadata>
- </Local-TX-datasource>
- </Datasources>
Since the data source can be dynamically released, after modification, refresh and you will see it. The data source has been configured.