You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt Krevs <ma...@bigpond.com> on 2004/06/30 02:17:47 UTC

SQLServer 2000 Driver for JDBC - setting selectmethod=cursor

Hi all

I am using the SQLServer 2000 Driver for JDBC with Tomcat 5 and have an
exception being raised whenever I try to execute more than one insert or
update using the same database connection. The exception is 

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't
start a cloned connection while in manual transaction mode.

I have searched various forums and have found that if you set
selectmethod=true it fixes the problem. However, I haven't yet found a
way to set this property. No matter what I do, tomcat or the driver
itself seems to ignore the setting.

Has anyone successfully been able to specify the 'selectmethod=true'
property? If someone could post a sample server.xml that would be great.
I have tried specifying 'SelectMethod' as a parameter and also tacked on
the end of the url with no luck. Actually, anything added to the url
(instead of specifying it as a parameter in the xm) seems to be ignored.

A snippet from my server.xml is as follows


<Resource name="jdbc/mater-exam" auth="Container"
type="com.microsoft.jdbcx.sqlserver.SQLServerDataSource"/>

  <ResourceParams name="jdbc/mater-exam">
	<parameter>
	  <name>factory</name>
	
<value>com.microsoft.jdbcx.sqlserver.SQLServerDataSourceFactory</value>
	</parameter>
	<parameter>
	  <name>maxActive</name>
	  <value>10</value>
	</parameter>
	<parameter>
	  <name>maxIdle</name>
	  <value>10</value>
	</parameter>
	<parameter>
	  <name>maxWait</name>
	  <value>10000</value>
	</parameter>
	<parameter>
	  <name>serverName</name>
	  <value>localhost</value>
	</parameter>
	<parameter>
	 <name>user</name>
	 <value>mater_exam</value>
	</parameter>
	<parameter>
	 <name>password</name>
	 <value>mater_exam</value>
	</parameter>
	<parameter>
	 <name>SelectMethod</name>
	 <value>cursor</value>
	</parameter>
	<parameter>
	   <name>driverClassName</name>
	
<value>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</value>
	</parameter>
	<parameter>
	  <name>url</name>
	  <value>jdbc:microsoft:sqlserver://localhost</value>
	</parameter>
  </ResourceParams>
</Context>

Any help much appreciated

Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org