Getting Exception while calling a stored procedure from Java

Posted on 2008-09-29
Last Modified: 2012-05-05

I am calling the stored procedure and executing it from java program as below....
(Please see the attachment of the java code...)
(Also please see the Stored procedure which my DBA written...)

Now When I call the proc from my java, its throwing the exception....
The 'CREATE TABLE' command is not allowed within a multi-statement transaction in the 'tempdb' database..

Please let me know ASAP. This is some what urgent.
Connection conn = null;

CallableStatement stmt = null;

ArrayList<String> resultList =  new ArrayList<String>();

String sql = "{? = call sp_auth_reconciliation_rept ?,?,?,?}";


try {

      conn = registry.getPooledConnection();

      stmt = conn.prepareCall(sql);

      stmt.registerOutParameter(1, java.sql.Types.INTEGER);

      stmt.setString(2, sSubSystemId);

      stmt.setString(3, sSunetId);

	stmt.setString(4, sFunction);

	stmt.setString(5, sStatus);


	if (_log.isDebugEnabled()) {

	_log.debug("invoking stored procedure");


	ResultSet rs = stmt.executeQuery();

	ResultSetMetaData rsmd = rs.getMetaData();

	int numberOfColumns = rsmd.getColumnCount();

	for (int i = 1; i <= numberOfColumns; i++) {




	while ( {

	        for (int i = 1; i <= numberOfColumns; i++) {






Open in new window

Question by:cbkvarma
LVL 23

Accepted Solution

cmalakar earned 500 total points
Comment Utility
sybase doesn't allow ddl commands to get executed in transactions.

You can enable that using the following command..

sp_dboption temp_db, "ddl in tran", true

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now