我使用了preparedstatement来执行一段sql,用callablestatement来执行一个存储,会建立两个connection,放在一个事务处理中,可以吗?
解决方案 »
- 子类为啥不能比父类抛出更多的异常?
- java断点续传如何实现
- java 多态问题
- textfield填写汉字时候导致JAVAX死机
- 关于用JButton时出现的问题,求解!!!
- 急:怎样对jpg图片进行BASE64编码
- 用utf-8编码(encode)unicode码时不会有信息损失,但禁止用utf-8解码非utf-8编码的字节流。总之Utf-8可以编码任何unicode 码,但只能解码
- javamail
- 为什么向一文本文件里写字符不成功?
- 谁有防止weblogic6.1过期的软件
- java写的SocketServer如何和c或vb写的client通信??
- 请问在java中可以调用用C++写的函数或程序吗吗…………………………!谢谢了
如果你使用了两个连接,则除非你使用XA事务,否则他们不在同一个事务中
While using the Microsoft SQL Server 2000 Driver for JDBC, you may experience the following exception:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode. CAUSE
This error occurs when you try to execute multiple statements against a SQL Server database with the JDBC driver while in manual transaction mode (AutoCommit=false) and while using the direct (SelectMethod=direct) mode. Direct mode is the default mode for the driver.
RESOLUTION
When you use manual transaction mode, you must set the SelectMethod property of the driver to Cursor, or make sure that you use only one active statement on each connection as specified in the "More Information" section of this article.