| Matt Neerincx [MSFT] 2005-10-12, 11:23 am |
| I got this configuration file to work in JBoss.
It creates 3 different datasources named SQLJDBC2005_NO_TXN,
SQLJDBC2005_LOCAL_TX
N, and SQLJDBC2005_XA.
Note that the XA configuration I have not fully tested yet, but I have
confirmed it works (allows connectivity and performs transactions).
Note I used -> java:SQLJDBC2005_NO_
TXN <- for example as the JNDI namespace
to pick up the datasource.
Here is the contents of sqljdbc2005-ds.xml ->
<?xml version="1.0" encoding="UTF-8"?>
<!-- The SQL Server 2005 Database JCA connection factory config $Id:
sql2005jdbc-ds.xml,v 1.0 2005/10/7 mattn Exp $ -->
<datasources>
<!-- Non-transactional datasource (uses no transactions) -->
<no-tx-datasource>
<!-- The jndi name of the DataSource, it is prefixed with java:/ -->
<!-- Datasources are not available outside the virtual machine -->
<jndi-name>SQLJDBC2005_NO_TXN</jndi-name>
<!-- The connection url -->
<connection-url>jdbc:sqlserver:// MySQLServer;database
Name=jboss;</connection-url>
<!-- The driver class -->
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<!-- The login and password -->
<user-name>jboss</user-name>
<password>jboss</password>
<!-- This will be run before a managed connection is removed from the pool
for use by a client-->
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<!-- The minimum connections in a pool/sub-pool. Pools are lazily
constructed on first use -->
<min-pool-size>5</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>20</max-pool-size>
</no-tx-datasource>
<!-- Local transaction datasource (uses no transactions) -->
<local-tx-datasource>
<!-- The jndi name of the DataSource, it is prefixed with java:/ -->
<!-- Datasources are not available outside the virtual machine -->
<jndi-name> SQLJDBC2005_LOCAL_TX
N</jndi-name>
<!-- The connection url -->
<connection-url>jdbc:sqlserver:// MySQLServer;database
Name=jboss;</connection-url>
<!-- The driver class -->
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<!-- The login and password -->
<user-name>jboss</user-name>
<password>jboss</password>
<!-- This will be run before a managed connection is removed from the pool
for use by a client-->
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<!-- The minimum connections in a pool/sub-pool. Pools are lazily
constructed on first use -->
<min-pool-size>5</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>20</max-pool-size>
</local-tx-datasource>
<!-- Transactional datasource (uses XA transactions) -->
<xa-datasource>
<!-- The jndi name of the DataSource, it is prefixed with java:/ -->
<!-- Datasources are not available outside the virtual machine -->
<jndi-name>SQLJDBC2005_XA</jndi-name>
<track-connection-by-tx/>
<isSameRM-override-value>false</isSameRM-override-value>
<!-- The datasource class and default properties -->
<xa-datasource-class>com.microsoft.sqlserver.jdbc. SQLServerXADataSourc
e</xa-datasource-class>
<xa-datasource-property
name="ServerName">MySQLServer</xa-datasource-property>
<xa-datasource-property name="DatabaseName">jboss</xa-datasource-property>
<!-- The login and password -->
<user-name>jboss</user-name>
<password>jboss</password>
<!-- This will be run before a managed connection is removed from the pool
for use by a client-->
<check-valid-connection-sql>select 1</check-valid-connection-sql>
<!-- The minimum connections in a pool/sub-pool. Pools are lazily
constructed on first use -->
<min-pool-size>5</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>20</max-pool-size>
</xa-datasource>
</datasources>
--
Matt Neerincx [MSFT]
This posting is provided "AS IS", with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"andrewhallam" < andrewhallam@discuss
ions.microsoft.com> wrote in message
news:8D9040B3-89E7-493C-9D2A- 71AA73C05DAF@microso
ft.com...
> Hello all.
>
> I have downloaded "sqljdbc_1.0.419.102_enu.exe" and am trying to evaluate
> this new driver but am wondering how I actually set my datasource up to
> use
> it.
> I am currently using jdbinsightMy current data source is thus:
> C:\JBoss\server\defa
ult\deploy\myds.xml :
>
> <datasources>
> <no-tx-datasource>
> <jndi-name>mydatabase</jndi-name>
>
> <connection-url> jdbc:jdbinsight:micr
osoft:sqlserver:// myserver:1433;Databa
seName=mydb;SelectMe
thod=cursor;</connection-url>
>
> <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
> <user-name>sa</user-name>
> <password></password>
> </no-tx-datasource>
> </datasources>
>
> Executing the download gives me the "sqljdbc.jar" file.
> I then put this into C:\JBoss\server\defa
ult\lib.
> But what changes do I then have to make to my datasource XML to pick up
> the
> new driver???
>
> Thanks for your help on this.
>
> Andy.
|