How to set MySQL data source in Jboss4: Put a JDBC driver of MySQL into CLASSPATH. Similarly, copy it to the/server/default/lib directory and the/docs/examples/jca/mysql-ds.xml to the/server/default/deploy directory. Modify my
How to set the MySQL data source in Jboss4:
Put the JDBC driver of MySQL into CLASSPATH. Similarly, copy it to the/server/default/lib directory.
Copy/docs/examples/jca/mysql-ds.xml to the/server/default/deploy directory. Correct the mysql-ds.xml file and set <driver-class/> to com. mysql. jdbc. then, set <connection-url/> to jdbc: mysql: // <mysqlhost>/<database>, where <mysqlhost> is the database host name <database> is the database name.
Three doc \ examples \ docs \ examples \ jms \ mysql-jdbc2-service to change D: \ JavaOne \ jboss4.0 \ server \ default \ deploy \ jms \ hsqldb-jdbc2-service
4. set the <datasource> and <type-mapping> elements of the default \ conf \ standardjaws. xml file:
<Jaws>
<Datasource> java:/MySqlDS </datasource>
<Type-mapping> mySql </type-mapping>
</Jaws>
You also need to set the <datasource> and <datasource-mapping> elements of the standardjbosscmp-jdbc.xml file to the following:
<Jbosscmp-jdbc>
<Defaults>
<Datasource> java:/MySqlDS </datasource>
<Datasource-mapping> mySql </datasource-mapping>
</Defaults>
</Jbosscmp-jdbc>
Five and then modify the login-config.xml file to apply MySQL:
<Application-policy name = 'mysqldbrealm'>
<Authentication>
<Login-module code =
'Org. jboss. resource. security. ConfiguredIdentityLoginModule'
Flag = 'required'>
<Module-option name = 'prinal Al'> sa </module-option>
<Module-option name = 'username'> sa </module-option>
<Module-option name = 'password'> </module-option>
<Module-option name = 'managedconnectionfactoryname'>
Jboss. jca: service = LocalTxCM, name = MySqlDS
</Module-option>
</Login-module>
</Authentication>
</Application-policy>
In the \ server \ default \ deploy \ ejb-deployer.xml file
Create table TIMERS (
TIMERID varchar (50) not null,
TARGETID varchar (50) not null,
INITIALDATE timestamp not null,
INTERVAL bigint,
INSTANCEPK other,
INFO other,
Constraint timers_pk primary key (TIMERID)
Change the other type to the bolb type.
After such preparation, the default jboss data source is changed to MySQL.