jQuery in Action, 2nd edition*
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Please help setting up with MSSQL DataSource." Watch "Please help setting up with MSSQL DataSource." New topic

Please help setting up with MSSQL DataSource.

nilesh bhattad

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 !!
I agree. Here's the link: http://aspose.com/file-tools
subject: Please help setting up with MSSQL DataSource.