Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC Error in MySQL Procedure Using JAVA Code
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Jasmine
Error in MySQL Procedure Using JAVA Code
4 Answer(s)      4 years and a month ago
Posted in : JDBC


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


Advertisement
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 :)



Related Tutorials/Questions & Answers:
Error in MySQL Procedure Using JAVA Code
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...("DELIMITER //\nCREATE PROCEDURE abdt (std INT)\nBEGIN\nSELECT attbegin, attend FROM
SHOWING ERROR CODE 1064 WHILE TRYING TO EXECUTE PROCEDURE
SHOWING ERROR CODE 1064 WHILE TRYING TO EXECUTE PROCEDURE  I AM TRYING A SP BUT IT IS NOT SAVING AND WORKING.DOES THE STORED PROCEDURE WORK PARTLY...)affected) (0 ms taken) Error Code : 1064 You have an error in your SQL syntax
Advertisements
remote procedure call using java - JSP-Servlet
remote procedure call using java  what is the romote procedure call and related coding in java?  Hi Friend, The RPC (Remote Procedure Call) is a mechanism that enables a remote procedure call from a client
Insert Data in Table Using Stored Procedure
;); 7.Step to call procedure: We are using CallableStatement to execute a stored procedure into java code. The following syntax is used to create an object... into a table using stored procedure. Steps: 1.Create database: To create
Processing stored procedure in MySQL - SQL
Processing stored procedure in MySQL  Dear All java with mysql developer..... i need to convert my SQL procedure to MySQL database... here is my Stored procedure in SQL.... create or replace procedure INVNAMES (bno
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
servelet connectivity with oracle using procedure
servelet connectivity with oracle using procedure   kindly elaborate how servlet code connect to oracle br using procedure
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
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
procedure with code - JavaMail
procedure with code  hi thank u for sending a suitable link. but in that no info about sent item folder creation. i want to place a SENT MAIL FOLDER like inbox. so all the mails that r send r srored in sent mails folder. pls
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
Error in a code. - Java Beginners
Error in a code.  This is the question I posted yesterday: "I'm.... I'm confused about where and what i should put into the overall code. Also I can't quite figure out how to write the code for the GUI. Could anyone please help
Java Code Color Function Error
Java Code Color Function Error  Java Code Color Function Error
java runtime error: JDBC code - Java Beginners
java runtime error: JDBC code  Hi i want to insert data into mysql database in my local system. I installed mysql5.0 and using mm.mysql-2.0.4-bin.jar and also set in the class path. the code is compilled and giving runtime error
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
website creation using java and mysql - Java Beginners
website creation using java and mysql  i am going to create a website for some company using java and mySql... i dont know the procedure to create a website.can anybody give me the steps what i have to follow
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
error in java code - Java Beginners
error in java code  Hi Can u say how to communication between systems in a network.   Hi friend, A method for controlling an operation.../java/network/index.shtml Thanks
Java error code
Java error code       Java Error code are the set of error that occurs during the compile-time and Run-time. From java error we have given  you a sample of code
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
jsp code error - Java Beginners
jsp code error  Hi, I have a problem with following code... part. Is it possible to display a message box or alert box in jsp code??. plz help...; Hi friend , Try this code: /*out.println("Login Failed
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
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
error in code - Java Server Faces Questions
error in code  hi friends i have a problem in execution of JSF it is displaying the error like "Cannot find FacesContext" i am not understanding plz check the error and give me the answer i am sending the code of web.xml
procedure
procedure   step by step procedure to build servlet or jsp in eclipse
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
procedure
procedure  write a procedure to update salary to 20% based on employee number
java code compling error - Java Beginners
java code compling error  i have face below problem,when compiling... this problem?  Hi Friend, Your code downcasts from Object to something else instead of using genericity. Use generic collections. For instance, you
Insert a row in 'Mysql' table using JSP Code
Insert a row in 'Mysql' table using JSP Code In this section, we will discuss about how to insert data in Mysql database using JSP code. Query...; Mysql database Table. Code to insert row in Mysql table : databaseinsertion.jsp
java code using while loop
java code using while loop  
Advertisements
 

 

 

DMCA.com