Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: issue in executing Stored Proc

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default issue in executing Stored Proc

    I am migrating the application from Websphere Application Server 6 to Websphere Application Server 7.

    During which I am facing the following Issue:

    ResultSet rs=cstmt.executeQuery(); working in WAS6 but not in WAS7

    Error is : com.ibm.db2.jcc.c.SqlException: java.sql.CallableStatement.executeQuery() was called but no result set was returned. Use java.sql.CallableStatement.executeUpdate() for non-queries.

    Since it is returning resultset that is the prob we can not do the action that is suggested by the error.
    If it would not have returning anythng then we could have used cstmt.executeUpdate().

    Code Overview:

      Connection conn = null;
        CallableStatement cstmt = null;
        ResultSet rs =null;
        Result rsFilter = null;
    	before = System.currentTimeMillis();
        String sqlstr="{call wdssappl_stp.get_Template(?,?,?,?,?,?,?,?,?,?)}";
         try {
        	   conn = sl.getWdss_Connection(); // get this from common service locator
        	     cstmt=conn.prepareCall(sqlstr);  
    	        cstmt.setString(1,"A");        
    			if(filter==null){cstmt.setNull(2,Types.VARCHAR);}
    	         	else {cstmt.setString(2,filter);}
    	         cstmt.setInt(3,iStartIdx);
    	         cstmt.setInt(4,iEndIdx);
    	         cstmt.setInt(5,iRoleId);
    	         cstmt.setString(6,tid);
    	         cstmt.registerOutParameter(7,Types.INTEGER);
    	         cstmt.registerOutParameter(8,Types.INTEGER);
    	         cstmt.registerOutParameter(9,Types.INTEGER);
    	         cstmt.registerOutParameter(10,Types.VARCHAR);	 
    	                System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
         	  	rs=cstmt.executeQuery();
      	rsFilter=ResultSupport.toResult(rs);
    	    after = System.currentTimeMillis();

    Can anyone suggest what should be done for that ???

    Thanks in Advance.
    Last edited by copeg; December 8th, 2010 at 09:00 AM.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,336
    Thanks
    181
    Thanked 830 Times in 773 Posts
    Blog Entries
    5

    Default Re: issue in executing Stored Proc

    If it worked in 6 but not 7, sounds like a issue with the software. I don't know what the problem actually is, but will point you in the direction of the Websphere Forums where your question might be more quickly addressed.

Similar Threads

  1. Replies: 0
    Last Post: November 13th, 2010, 04:08 PM
  2. unable to view the result generated by stored procedure
    By najmudeenhaja in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 1st, 2010, 08:39 AM
  3. Is it possible to export Stored Procedures using JDBC?
    By sid7 in forum JDBC & Databases
    Replies: 0
    Last Post: August 28th, 2010, 05:34 PM
  4. Value Not Being Stored
    By aussiemcgr in forum What's Wrong With My Code?
    Replies: 0
    Last Post: August 16th, 2010, 09:38 AM
  5. Executing Oracle Procedure
    By java_mein in forum JDBC & Databases
    Replies: 0
    Last Post: May 14th, 2010, 02:41 PM