简体   繁体   English

到底应该在哪里更改JDBC URL值?

[英]Where exactly should JDBC URL value be changed?

I'm trying to run some application and get the following error: 我正在尝试运行某些应用程序并出现以下错误:

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode. java.sql.SQLException:[Microsoft] [用于JDBC的SQLServer 2000驱动程序]在手动事务模式下无法启动克隆的连接。

I know that I should add the parameter ;SelectMethod=Cursor to your JDBC URL 我知道我应该将参数; SelectMethod = Cursor添加到您的JDBC URL

But I'm having problem understanding where exactly should I change it? 但是我在理解应该在哪里进行更改时遇到问题? Should it be some conf file in JDBC driver folder somewhere? 它应该是JDBC驱动程序文件夹中某个位置的conf文件吗? Or can I do it from sql management studio? 还是可以从sql management studio中做到这一点? Also is there some easy way to determine if and what version of JDBC driver I have? 还有一些简单的方法可以确定我是否拥有JDBC驱动程序以及具有哪个版本的JDBC驱动程序?

Help is very much appreciated! 非常感谢您的帮助!

You specify the URL when creating your JDBC connection, eg: 您在创建JDBC连接时指定URL,例如:

Connection con = DriverManager.getConnection(
   "jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]",
   username,
   password);

Of course you have to replace the stuff in the brackets with your values. 当然,您必须用值替换括号中的内容。

Quite the same is true for every other tool (eg IntelliJ, Eclipse) I know of that connects to a DB via JDBC. 我所知道的所有其他工具(例如IntelliJ,Eclipse)都通过JDBC连接到DB,这同样如此。 See eg attached screenshot. 参见例如所附的屏幕截图。 Here you also specify the connection parameters via the JDBC URL. 在这里,您还可以通过JDBC URL指定连接参数。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 打印矩阵的对角线并将其显示在屏幕上,以便每个值精确显示应在的位置 - Printing the diagonals of the matrix and showing it on the screen so that every value shows exactly where it should be 我应该在哪里保存JDBC连接详细信息? - Where should I save the JDBC connectivity details? 我应该在哪里把ehcache.xml放在我的项目中? - Where exactly should I put ehcache.xml in my project? 我应该在哪里(确切地)在我的Java EE应用程序中使用同步 - Where (exactly) should i use synchronization in my Java EE application JDBC驱动程序JAR文件应该驻留在具有数据源的Tomcat部署中的哪个位置? - Where should the JDBC driver JAR files reside on a Tomcat deployment with a datasource? 在Kruskal算法的Java实现中,到底应该在哪里执行路径压缩? - In Java implementation of Kruskal's algorithm where exactly should we perform Path Compression? How should I write JDBC url for Oracle with LDAP and two LDAP servers? - How should I write JDBC url for Oracle with LDAP and two LDAP servers? 在哪里关闭 JDBC 中的语句 - Where to close statements in JDBC 在哪里下载JDBC驱动程序 - Where to Download JDBC Driver 在哪里使用jdbc Rowsets? - Where jdbc Rowsets are used?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM