-
1. Re: Connecting to a database through named instance,mssql-ds
jaikiran Jun 20, 2008 6:26 AM (in response to srawan)Which driver do you use? Is it Microsoft driver or is it the jTDS driver?
-
2. Re: Connecting to a database through named instance,mssql-ds
jdriver Jul 28, 2008 4:48 PM (in response to srawan)I have the same question. I have an app written to Hypersonic and now need to translate the db configs to use SQL Server 2005 with jdts.
I have the following config but getting an error in the mbean code="org.jboss.jdbc.SQLServerDatabase" line. I just guessed at that. It used to say HypersonicDatabase:
<local-tx-datasource>
<jndi-name>myDS</jndi-name>
<connection-url>jdbc:jtds:sqlserver://mymachine:1433/mydb</connection-url>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<user-name>sa</user-name>
mypass
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<track-statements/>
<type-mapping>SQL Server</type-mapping>
jboss:service=MSSQL-db,database=mydb
</local-tx-datasource>
1701
true
mydb
false
true -
3. Re: Connecting to a database through named instance,mssql-ds
jdriver Jul 28, 2008 4:57 PM (in response to srawan)Going to try and post the code again:
<datasources> <local-tx-datasource> <jndi-name>myDS</jndi-name> <connection-url>jdbc:jtds:sqlserver://mymachine:1433/MYDB</connection-url> <driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class> <user-name>sa</user-name> <password>mypass</password> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>0</idle-timeout-minutes> <track-statements/> <metadata> <type-mapping>SQL Server</type-mapping> </metadata> <depends>jboss:service=MSSQL-db,database=mydb</depends> </local-tx-datasource> <mbean code="org.jboss.jdbc.SQLServerDatabase" name="jboss:service=MSSQL-db,database=mydb"> <attribute name="Port">1701</attribute> <attribute name="Silent">true</attribute> <attribute name="Database">labordb</attribute> <attribute name="Trace">false</attribute> <attribute name="No_system_exit">true</attribute> </mbean> </datasources>
-
4. Re: Connecting to a database through named instance,mssql-ds
peterj Jul 28, 2008 5:00 PM (in response to srawan)You do not need that MBean - that was for Hypersonic only, and then only if running it as a service. Look at the example *-ds.xml file in docs/examples/jca, there is one there for SQL Server.