You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by "vlad.balan" <vl...@gmail.com> on 2011/03/03 18:38:33 UTC

"JTAManaged" DataSources and their "JdbcDriver" classname

Hi,

in the doc
(http://openejb.apache.org/3.0/configuring-datasources-in-tests.html) we see
for example:

p.put("myDataSource", "new://Resource?type=DataSource");
p.put("myDataSource.JdbcDriver", "org.apache.derby.jdbc.EmbeddedDriver");
p.put("myDataSource.JdbcUrl", "jdbc:derby:derbyDB;create=true");
p.put("myDataSource.JtaManaged", "true");

For MySQL, what should i put in "myDataSource.JdbcDriver" for a datasource
with "JtaManaged". Which of these 3 provided by MySQL:


- com.mysql.jdbc.jdbc2.optional.MysqlDataSource
- com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
- com.mysql.jdbc.jdbc2.optional.MysqlXADataSource


In you examples here
(http://openejb.apache.org/3.0/common-datasource-configurations.html)
you use "com.mysql.jdbc.Driver" which is provided by MySQL for
DriverManager.getConnection() style of getting connections .
(com.mysql.jdbc.Driver implements java.sql.Driver, not
javax.sql.XADataSource) :


    #  MySQL example
    #
    #  This connector will not work until you download the driver at:
    #  http://www.mysql.com/downloads/api-jdbc-stable.html

    JdbcDriver  com.mysql.jdbc.Driver
    JdbcUrl     jdbc:mysql://localhost/test
    UserName    test



So i'm a bit disoriented.


See here for mysql doc:
http://dev.mysql.com/doc/refman/5.5/en/connector-j-installing-classpath.html

"
Starting with Connector/J 5.0.0, the javax.sql.XADataSource interface is
implemented using the com.mysql.jdbc.jdbc2.optional.MysqlXADataSource class,
which supports XA distributed transactions when used in combination with
MySQL server version 5.0. 
"

--
View this message in context: http://openejb.979440.n4.nabble.com/JTAManaged-DataSources-and-their-JdbcDriver-classname-tp3333808p3333808.html
Sent from the OpenEJB User mailing list archive at Nabble.com.