I. configuration of Jboss3.0-Tomcat4.03 database (using Oracle as an example)
1. Add classes12.zip to classpath.
2. Please refer to the hsqldb-service.xml file to compile the Oracledb-service.xml File
Open the hsqldb-service.xml file under the serverdefadedeploy directory, this is an example of database connection under Jboss3.0 _ atat4.03, it is connected to the hsql database its content is as follows:
& Lt? Xml version = "1.0" encoding = "UTF-8 "? & Gt
& Lt! -- ===================================================== ===================================-- & Gt
& Lt! -- & Gt
& Lt! -- JBoss Server Configuration -- & gt
& Lt! -- & Gt
& Lt! -- ===================================================== ===================================-- & Gt
& Lt! -- $ Id: hsqldb-service.xml, v 1.2.2.5 2002/06/23 21:25:58 d_jencks Exp $ -- & gt
& Lt server & gt
& Lt! -- ===================================================== =======================================-- & Gt
& Lt! -- New ConnectionManager setup for default hsql dbs -- & gt
& Lt! -- Build jmx-api (build/build. sh all) and view for config documentation -- & gt
& Lt! -- ===================================================== =======================================-- & Gt
& Lt mbean code = "org. jboss. resource. connectionmanager. LocalTxConnectionManager" name = "jboss. jca: service = LocalTxCM, name = hsqldbDS" & gt
& Lt! -- Include a login module configuration named HsqlDbRealm.
Update your login-conf.xml, here is an example for
ConfiguredIdentityLoginModule:
& Lt application-policy name = "HsqlDbRealm" & gt
& Lt authentication & gt
& Lt login-module code = "org. jboss. resource. security. ConfiguredIdentityLoginModule" flag = "required" & gt
& Lt module-option name = "principal" & gtsa & lt/module-option & gt
& Lt module-option name = "userName" & gtsa & lt/module-option & gt
& Lt module-option name = "password" & gt & lt/module-option & gt
& Lt module-option name = "managedConnectionFactoryName" & gtjboss. jca: service = LocalTxCM, name = hsqldbDS & lt/module-option & gt
& Lt/login-module & gt
& Lt/authentication & gt
& Lt/application-policy & gt
NOTE: the application-policy name attribute must match
SecurityDomainJndiName, and
Module-option name = "managedConnectionFactoryName"
Must match the object name of the ConnectionManager you are creating here.
-- & Gt
& Lt! -- Uncomment out this line if you are using the DB2DbRealm abve
& Lt attribute name = "SecurityDomainJndiName" & gtHsqlDbRealm & lt/attribute & gt
-- & Gt
& Lt depends optional-attribute-name = "ManagedConnectionFactoryName" & gt
& Lt! -- Embedded mbean -- & gt
& Lt mbean code = "org. jboss. resource. connectionmanager. RARDeployment" name = "jboss. jca: service = LocalTxDS, name = hsqldbDS" & gt
& Lt attribute name = "JndiName" & gtDefaultDS & lt/attribute & gt
& Lt attribute name = "ManagedConnectionFactoryProperties" & gt
& Lt properties & gt
& Lt config-property name = "ConnectionURL" type = "java. lang. String" & gtjdbc: hsqldb: hsql: // localhost: 1476 & lt/config-property & gt
& Lt config-property name = "DriverClass" type = "java. lang. String" & gtorg. hsqldb. jdbcDriver & lt/config-property & gt
& Lt config-property name = "UserName" type = "java. lang. String" & gtsa & lt/config-property & gt
& Lt config-property name = "Password" type = "java. lang. String" & gt & lt/config-property & gt
& Lt/properties & gt
& Lt/attribute & gt
& Lt! -- Below here are advanced properties -- & gt
& Lt! -- Hack -- & gt
& Lt depends optional-attribute-name = "OldRarDeployment" & gtjboss. jca: service = RARDeployment, name = JBoss LocalTransaction JDBC Wrapper & lt/depends & gt
& Lt depends & gtjboss: service = Hypersonic & lt/depends & gt
& Lt/mbean & gt
& Lt/depends & gt
& Lt depends optional-attribute-name = "ManagedConnectionPool" & gt
& Lt! -- Embedded mbean -- & gt
& Lt mbean code = "org. jboss. resource. connectionmanager. JBossManagedConnectionPool" name = "jboss. jca: service = LocalTxPool, name = hsqldbDS" & gt
& Lt attribute name = "MinSize" & gt0 & lt/attribute & gt
& Lt attribute name = "MaxSize" & gt50 & lt/attribute & gt
& Lt attribute name = "BlockingTimeoutMillis" & gt5000 & lt/attribute & gt
& Lt attribute name = "IdleTimeoutMinutes" & gt15 & lt/attribute & gt
& Lt! -- Criteria indicates if Subject (from security domain) or app supplied
Parameters (such as from getConnection (user, pw) are used to distinguish
Connections in the pool. Choices are
ByContainerAndApplication (use both ),
ByContainer (use Subject ),
ByApplication (use app supplied params only ),
ByNothing (all connections are equivalent, usually if adapter supports
Reauthentication) -- & gt
& Lt attribute name = "Criteria" & gtByContainer & lt/attribute & gt
& Lt/mbean & gt
& Lt/depends & gt
& Lt depends optional-attribute-name = "CachedConnectionManager" & gtjboss. jca: service = CachedConnectionManager & lt/depends & gt
& Lt depends optional-attribute-name = "JaasSecurityManagerService" & gtjboss. security: service = JaasSecurityManager & lt/depends & gt
& Lt attribute name = "TransactionManager" & gtjava:/TransactionManager & lt/attribute & gt
& Lt! -- Make the rar deploy! Hack till better deployment -- & gt
& Lt depends & gtjboss. jca: service = RARDeployer & lt/depends & gt
& Lt/mbean & gt
& Lt! -- Moved to end to test anonymous depends -- & gt
& Lt mbean code = "org. jboss. jdbc. HypersonicDatabase"
Name = "jboss: service = Hypersonic" & gt
& Lt attribute name = "Port" & gt1476 & lt/attribute & gt
& Lt attribute name = "Silent" & gttrue & lt/attribute & gt
& Lt attribute name = "Database" & gtdefault & lt/attribute & gt
& Lt attribute name = "Trace" & gtfalse & lt/attribute & gt
& Lt/mbean & gt
& Lt/server & gt
In & lt! -- & Gt is useless between some instructions, so remove these instructions after rewriting a file to access oracle database services XML is Oracledb-service.xml
& Lt? Xml version = "1.0" encoding = "UTF-8 "? & Gt
& Lt server & gt
& Lt mbean code = "org. jboss. resource. connectionmanager. LocalTxConnectionManager" name = "jboss. jca: service = LocalTxCM, name = oracleDS" & gt
& Lt depends optional-attribute-name = "ManagedConnectionFactoryName" & gt
& Lt! -- Embedded mbean -- & gt
& Lt mbean code = "org. jboss. resource. connectionmanager. RARDeployment" name = "jboss. jca: service = LocalTxDS, name = oracleDS" & gt
& Lt attribute name = "JndiName" & gtOracleDS & lt/attribute & gt
& Lt attribute name = "ManagedConnectionFactoryProperties" & gt
& Lt properties & gt
& Lt config-property name = "ConnectionURL" type = "java. lang. String" & gtjdbc: oracle: thin: @ cuipeng: 1521: Ora8 & lt/config-property & gt
& Lt config-property name = "DriverClass" type = "java. lang. String" & gtoracle. jdbc. driver. OracleDriver & lt/config-property & gt
& Lt config-property name = "UserName" type = "java. lang. String" & gtsystem & lt/c