Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
below what i tried please help me


Error in RESULT: Callable statements not supported.
I am using JSP front end and for Backend using MYSQL 5.6
Please Help me

What I have tried:

`<%@page import="java.sql.CallableStatement"%>
<%@page language="java" import="com.DBConnection"%> 
<%
    DBConnection dbc = null;
    java.sql.Connection con = null;
    java.sql.Statement stmt = null;
    java.sql.ResultSet rst = null, rstInnr = null;
    try {
        dbc = new DBConnection();
        con = dbc.getConnection();
        stmt = con.createStatement();
        
CallableStatement statement = con.prepareCall("{call SP_CustomerDetails(NULL,'919673677400',NULL)}");

        rst = statement.executeQuery();
        
        
        if (rst.next()) {

            rst.beforeFirst();
%>


        <table border=1 align="center" cellspacing="0" cellpadding="1">
	<tr>
            <th>Name</th>
            <th>Address</th>
            <th>TELE</th>
            
	</tr>

<%
        while(rst.next())
	{
%>
            <tr>
                <td> <%=rst.getString("CustomerName")%></td>
                <td> <%=rst.getString("CustomerAddress")%></td>
                <td> <%=rst.getString("TELEPHONE1")%></td>
                
            </tr>
<%
        }
        rst.close();
%>
		</table>
<%
        }
        
    }
    catch(Exception e)
    {
        out.println("Error in RESULT : " + e.getMessage());
    }
%>
`
    


above is my JSP file when I run I got ERROR  : 
Error in RESULT: Callable statements not supported. 
I am using JSP front end and for Backend using MYSQL 5.6
Please Help me 
Posted
Updated 27-Apr-20 0:01am

1 solution

I don't think you can pass parameters values directly in the prepareCall call.
The documentation would suggest to do it this way instead:
Java
CallableStatement statement = con.prepareCall("{call SP_CustomerDetails(?, ?, ?)}");
statement.setString(2, "919673677400");
// ...

6.3 Using JDBC CallableStatements to Execute Stored Procedures[^]
 
Share this answer
 
Comments
hareshdgr8 27-Apr-20 7:48am    
No Sir I Can Pass Value
When I Use Your Method Error Remain Same Sir
phil.o 27-Apr-20 7:54am    
Then check that you are using a JDBC/MySQL connector version at least 3.1.1, because the error message suggests that the version you are actually using does not implement this functionality.
hareshdgr8 27-Apr-20 10:16am    
sir mysql i am using 5.6 Version and connector mysql-connector-java-8.0.19
phil.o 27-Apr-20 11:08am    
Then you should ask this on MySQL forums, as diagnosing your issue requires some informations that we don't have.
MySQL Forums :: Connector/J, JDBC and Java[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900