permaculture playing cards*
The moose likes JDBC and the fly likes Please help setting up with MSSQL DataSource. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Please help setting up with MSSQL DataSource." Watch "Please help setting up with MSSQL DataSource." New topic
Author

Please help setting up with MSSQL DataSource.

nilesh bhattad
Greenhorn

Joined: Jan 15, 2003
Posts: 8
Dear Friends,
I'm trying to setup a MSSQL DataSource in WSAD. I have following settings in server-cfg.xml
URL Prefix : jdbc:microsoft:sqlserver://MFXE2KSQL01V:4141;DatabaseName=RiskAppetite;selectMethod=cursor
Implementation class name : com.microsoft.jdbcx.sqlserver.SQLServerDataSource
And the JAVA code is..
Context ctx = (Context) new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/RiskAppetite");
Connection con = ds.getConnection("RiskAppetiteAppId", "RiskAppetiteAppId");
I'm able to get a DataSource handle from JNDI. While trying to get a connection, I get a following exception
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]JTA is not support when selectMethod=direct. Switch to selectMethod=cursor.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbcx.sqlserver.SQLServerDataSource.getXAConnection(Unknown Source)
at com.ibm.ejs.cm.pool.JTAConnectionFactory.createConnection(JTAConnectionFactory.java:40)
at com.ibm.ejs.cm.pool.ConnectionPool.createConnection(ConnectionPool.java:932)
at com.ibm.ejs.cm.pool.ConnectionPool.createOrWaitForConnection(ConnectionPool.java:860)

As you can see in my URL Prefix, I specified "selectMethod=cursor" But for some reason, I'm still getting the above error. Please let me know if anyone has a solution on this.
Thanks in advance !!
Regards
Nilesh
 
Consider Paul's rocket mass heater.
 
subject: Please help setting up with MSSQL DataSource.
 
Similar Threads
Am I doing anything wrong while setting up SQLServerDataSource.....
Connection Error WSAD to SQL Server
Error connecting to MSSQL Server from Hibernate
"Could not find stored procedure" Error
wsad 4.03 selectMethod=????