Error in MySQL Procedure Using JAVA Code

Ads
 

Error in MySQL Procedure Using JAVA Code

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 ;");

View Answers

November 25, 2010 at 12:59 PM

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


November 25, 2010 at 1:01 PM

Hello Friend,

Please visit the following link:

http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml

Thanks


November 25, 2010 at 1:01 PM

Hello Friend,

Please visit the following link:

http://www.roseindia.net/mysql/mysql5/stored-procedures-and-functions.shtml

Thanks


November 25, 2010 at 1:31 PM

Thanks a lot :)

Ads









Related Tutorials/Questions & Answers:
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
Advertisements
java code using swings
java code using swings  code that should be able to enter data of student details using all swings into the access database using jdbc connectivity
Java code error - Java Beginners
Java code error  Hi, I am using a MooreQuery to look for neighbors in a grid: MooreQuery query = new MooreQuery(grid, this,(int) (2*myHomeRangeRadius), (int) (2*myHomeRangeRadius)); if(query != null){ for (Object
Java Code Color Function Error
Java Code Color Function Error  Java Code Color Function Error
java code using while loop
java code using while loop  
java code for PartialSearch using Map????
java code for PartialSearch using Map????  java code for Partial Search using Map
Change root password of MYSQL using Java
Change root password of MYSQL using Java In this tutorial, you will learn how to change the root password of MYSQL database using java code. For every... of Code: Changing the root password of a MySQL database is trivial if you know
servelet connectivity with oracle using procedure
servelet connectivity with oracle using procedure   kindly elaborate how servlet code connect to oracle br using procedure
java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement
java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement  hi class...%2!=0); System.out.println(error
java code for registration and login pages, mysql as a bankend.
java code for registration and login pages, mysql as a bankend.  please send me the java code for registration and login pages and to store the data in mysql
How to convert Mssql Procedure into Mysql Procedure.
How to convert Mssql Procedure into Mysql Procedure.  Hello Sir, I have a mssql procedure and i need it to be converted to mysql ... Below is my mssql procedure code.. WITH CTE AS ( SELECT ROW
How to convert Mssql Procedure into Mysql Procedure.
How to convert Mssql Procedure into Mysql Procedure.  Hello Sir, I have a mssql procedure and i need it to be converted to mysql ... Below is my mssql procedure code.. WITH CTE AS ( SELECT ROW
passing xml created using DocumentBuilderFactory as input to oracle stored procedure using java JDBC
procedure using java JDBC  I want to send the xml as input parameter... and it is to be send using JDBC. Stored procedure in oracle database will contains two... is my java code... import java.io.; import javax.xml.parsers.; import
HOW TO SAVE XML INTO MYSQL AND RETRIEVE IT USING JAVA
HOW TO SAVE XML INTO MYSQL AND RETRIEVE IT USING JAVA  H ello, i have an xml code, i need to save it into mysql 5.5 server database using java. i... xml code <Details> <title>Name</title> <addr>
code for multiplication of matrix in java using methods
code for multiplication of matrix in java using methods  code for multiplication of matrix in java using methods
parsing xml file using java code
parsing xml file using java code  parsing a xml file using java code
downloading a file directly from mysql using java
downloading a file directly from mysql using java  Hi, I am trying to come up with a code to download a file that is on a mysql database (in form of a blob) without using url. Can anyone tell me how it can be done because I am
Mysql Alter Procedure
Mysql Alter Procedure     ... that is executed under one name. Mysql Alter Procedure is used to modify... illustrate an example from 'Mysql Alter Procedure'. To grasp Example, we create
Mysql Declare Procedure
Mysql Declare Procedure        Mysql Declare Procedure is used to define a local variable within... with Example The Tutorial grasp you an example from 'Mysql Declare Procedure
Code error
) read.close(); } } } While using this it shows error as: run...Code error  package trail; import...(ClassLoader.java:247) ... 17 more Java Result: 1 BUILD SUCCESSFUL (total time: 9
Mysql Alter Procedure
Mysql Alter Procedure     ... that is executed under one name. Mysql Alter Procedure is used to modify and redefine... an example from 'Mysql Alter Procedure'. To grasp Example, we create a table
Reading RDF file using Java code in Eclipse
Reading RDF file using Java code in Eclipse  Could you please tel me what this statement means - Model model = ModelFactory.createDefaultModel
java code using combobox,radiobutton,checkbox
java code using combobox,radiobutton,checkbox  hi, send me java code for entering student details into ms access database, the code should includes combo box,radiobutton and checkboxes pl send as early as possible
View source code of a html page using java ..
View source code of a html page using java ..  I could find the html source code of a web page using the following program, http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLConnection.html i could get the html code
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance
sending data to google chart api from mysql database using java
sending data to google chart api from mysql database using java  how to send data from mysql database to google chart api using java
java plugin code for nutch using filter indexer
java plugin code for nutch using filter indexer  hello: i want... in the doc.add(name,value) . I don't know what is the error in it. Tthis is the code... = conf; } } I think that the error is in using parsedData but I don't know what I
Java Compilation error. Hibernate code problem. Struts first example - Hibernate
Java Compilation error. Hibernate code problem. Struts first example  Java Compilation error. Hibernate code problem. Struts first example
determinant of n*n matrix using java code
determinant of n*n matrix using java code  Here is my code: import java.util.Scanner.*; import java.util.*; public class determinantcode { double A[][]; double m[][]; int N; public input() { Scanner s=new
Java code for Saving Marathi (Indian local language ) in Mysql and retrieving the same
Java code for Saving Marathi (Indian local language ) in Mysql and retrieving... going to save the marathi data into mysql and trying to retrieving the same from java using eclipse but after saving it shows " ???? " in place of marathi words

Ads