-
1. Re: Jboss - MS SQLSERVER2000 configuration problem
mbaptist Aug 20, 2004 11:32 AM (in response to asite)Hi,
Here is the Datasource definition we are using to connect to a MS-SQLServer 2000 from a Linux Jboss server:
(replace jndi name and properties values with your own...)
<local-tx-datasource>
<jndi-name>jdbc/DSNAME</jndi-name>
<connection-url>jdbc:microsoft:sqlserver://DBSERVER:xxxx;ServerName=DBSERVER;PortNumber=xxxx;DatabaseName=DBNAME;User=DBUSER;Password=DBUSERPWD;SelectMethod=cursor</connection-url>
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
<user-name>DBUSER</user-name>
DBUSERPWD
<prepared-statement-cache-size>50</prepared-statement-cache-size>
<min-pool-size>5</min-pool-size>
<max-pool-size>50</max-pool-size>
<idle-timeout-minutes>15</idle-timeout-minutes>
<track-statements>false</track-statements>
</local-tx-datasource>
Here is also a piece of code:
Context context = new InitialContext();
Object ref_ms = context.lookup("java:/jdbc/DSNAME");
DataSource ds_ms =
(DataSource) PortableRemoteObject.narrow(ref_ms, DataSource.class);
connection_ms = ds_ms.getConnection();
...
prepStmt = connection_ms.prepareStatement(DbRequest);
rs = prepStmt.executeQuery();
...
rs.close();
prepStmt.close();
connection_ms.close();
...
hope this will help you ;-)
Br, -
2. Re: Jboss - MS SQLSERVER2000 configuration problem
asite Aug 23, 2004 2:53 AM (in response to asite)Thanks Marc,
I change my connection-url with the Yours .
Now its working.
Thanks.