Note that there are some explanatory texts on larger screens.

plurals
  1. POStored procedure not giving accurate results from java code
    primarykey
    data
    text
    <p>I have stored procedure that searches persons on basis of any given inputs (any bio data e.g blood group, name, identity no. etc. taking almost 26 inputs). </p> <p>I am executing a stored procedure (sql server) from java using <code>Callable Statement</code> <code>preparecall</code> method. Previously I had a problem that my stored procedure was not giving any results (0 row result) whenever the string input was passed in one of its many input parameters. On other hand gave correct results when any integer type parameter value was passed but when I changed <code>jdbc</code> driver from <code>jdbc:odbc</code> driver to <code>sqlserver</code> driver (<code>driver name=com.microsoft.sqlserver.jdbc.SQLServerDrive</code>), the problem was solved.</p> <p>Now my new problem is that when my procedure <code>procSearch2</code>, that is taking 16 inputs, is running it gives results perfectly fine with the same <code>Connection</code> variable of <code>jdbc</code> driver (changed one), but the other procedure, which have 27 inputs (<code>procSearch1</code>) is not giving any results even with <code>int</code> or <code>string</code> input values passed. </p> <p>It does not give any error it just returns me 0 row result where it should return 3 rows result.</p> <p>here is the code </p> <pre><code> CallableStatement stmt=connect.prepareCall("{CALL procSearch1(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}"); stmt.setInt(1,0); stmt.setString(2,""); stmt.setString(3,""); . . . stmt.setInt(27,0); ResultSet result=stmt.executeQuery(); if(result!=null) { System.out.println(result.getRow()); while(result.next) { System.out.println(result.getString("Name")); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload