Hi
I am using sybase database and trying to call a SP.
The following code i am using.
import java.sql.*;
public class javaTest
{
public static void main(
String [] str1)
{
try
{
String svr = "tkd-imsyb-01.tk.jp.chase.com:4100";
String uid ="JBOND";
String pwd ="waltherppk";
String department = "MTB";
Class.forName("com.sybase.jdbc2.jdbc.SybDriver");
Connection con = DriverManager.getConnection("jdbc:sybase:Tds:"+svr,uid, pwd);
Statement stm = con.createStatement();
ResultSet rst = stm.executeQuery("exec get_user_func 'YKIDACHI','cftrade' ");
while(rst.next())
{
System.out.println("-----:"+rst.getString(0));
}
}catch(Exception e)
{
e.printStackTrace();
}
}
}
When i run this program its giving the following exception.
java.sql.SQLException: JZ0R2: No result set for this query.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:482)
at com.sybase.jdbc2.jdbc.SybStatement.queryLoop(SybStatement.java:1525)
at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:149
5)
at com.sybase.jdbc2.jdbc.SybStatement.executeQuery(SybStatement.java:402
)
at javaTest.main(javaTest.java:22)
If i execute the SP from isql it gives me a result.
Can some body help me.
Radha