Hi!

I'm not sure about the Allen Fogleson's example but I can list the steps
as follow and hope they will help :-

1. Make sure you've got the JDBC driver jar file
"mm.mysql-2.0.4-bin.jar" and put it into %JBOSS_HOME%\lib\ext. It will
be loaded into classpath automatically when you start JBOSS.
2. Create a new database record in mysql, let's call it "sample".
3. Create a new "temp" table with sql statement such as "create table
temp (...)".
4. You need to modify the jboss.jcml file with the following sections :-
-> <mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
     <attribute name="Drivers">org.gjt.mm.mysql.Driver</attribute>  <!--
this driver class is within mm.mysql-2.0.4-bin.jar -->
   </mbean>
-> <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=mySQL">
     <attribute name="PoolName">mySQL</attribute>
     <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
     <attribute name="Properties"></attribute>
     <attribute name="URL">jdbc:mysql://localhost/sample</attribute> 
<!-- sample is the DB name -->
     <attribute name="GCMinIdleTime">1200000</attribute>
     <attribute name="JDBCUser">username</attribute>  <!-- configure
username with your mysql admin prog. -->
     <attribute name="MaxSize">10</attribute>
     <attribute name="Password">password</attribute>  <!-- configure
password with your mysql admin prog. -->
     <attribute name="GCEnabled">false</attribute>
     <attribute name="InvalidateOnError">false</attribute>
     <attribute name="TimestampUsed">false</attribute>
     <attribute name="Blocking">true</attribute>
     <attribute name="GCInterval">120000</attribute>
     <attribute name="IdleTimeout">1800000</attribute>
     <attribute name="IdleTimeoutEnabled">false</attribute>
     <attribute name="LoggingEnabled">false</attribute>
     <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
     <attribute name="MinSize">0</attribute>
   </mbean>
5. Start JBOSS and you'll see something like...
   [JDBC provider] Initializing
   [JDBC provider] Loaded JDBC-driver:org.gjt.mm.mysql.Driver
   [JDBC provider] Initialized
   [mySQL] Initializing
   [mySQL] Initialized
   ...
   [JDBC provider] Starting
   [JDBC provider] Started
   [mySQL] Starting
   [mySQL] XA Connection pool Sac bound to java:/mySQL
   [mySQL] Started
   So the JNDI name "java:/mySQL" is bound.
6. Modify the jboss.xml of your EJB with the following line :-
   <resource-manager>
     <res-name>jdbc/xxxDB</res-name>  <!-- DB name used in your EJB -->
     <res-jndi-name>java:/mySQL</res-jndi-name>
   </resource-manager>
   Pack it together with ejb-jar.xml and all your EJB class file into
jar file and deploy it.

Richard Bottoms wrote:
> 
> At 05:30 PM 6/21/01 +0800, you wrote:
> >Hi,
> >
> >This is the one I use to make mySQL work. Hope it's useful to you too.
> >Don't forget to put mm.mysql-2.0.4-bin.jar in %JBOSS_HOME%\lib\ext.
> 
> It's installed. Could you give a simple example of how to use it?
> 
> May I suggest using Allen Fogleson's Simple Hello tutorial and expanding it
> to access a MySQL database.
> 
> Thanks,
> r.b.
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to