
The following Java code (using Connector/J to create a stored procedure on MySQL 5.0) does not execute successfully. Identify the cause and available solutions.
statement.execute("DELIMITER //\nCREATE PROCEDURE abdt (std INT)\nBEGIN\nSELECT attbegin, attend FROM abdt WHERE student_id = std;\n\nEND;\n//\nDELIMITER ;");

Hi Friend,
You can use the following way:
String query="";
query = "CREATE PROCEDURE process_something (IN input_id BIGINT)\n";
query+= "BEGIN\n";
query+= "DECLARE num_rows, cnt, last_id INT DEFAULT 0;\n";
query+= "DECLARE indx_found INT DEFAULT 0;\n";
query+= _mainStoreProcedureBody;
query+= "END\n";
Connection con= session.connection();
Statement st= con.createStatement();
st.executeUpdate(query);
Thanks

Hello Friend,
Please visit the following link:
http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml
Thanks

Hello Friend,
Please visit the following link:
http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml
Thanks

Thanks a lot :)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.