MySQL Forums
Forum List  »  Stored Procedures

Re: weird error in my JDBC code
Posted by: Guy Harrison
Date: October 18, 2005 05:47PM

This works for me (Connector/J version 3.1.10):

static public void outparameter(Connection MyConnect) throws SQLException {

CallableStatement PreparedProc = MyConnect
.prepareCall("{CALL hello(?)}");
PreparedProc.registerOutParameter(1, Types.CHAR);
boolean hasResults = PreparedProc.execute();
String what = PreparedProc.getString(1);
System.out.println(what);
}

The stored procedure definition looks like this:

CREATE PROCEDURE hello(OUT outparm VARCHAR(20)) NO SQL
BEGIN
SET outparm='World';
END$$

Options: ReplyQuote


Subject
Views
Written By
Posted
3093
October 12, 2005 07:04PM
1989
October 13, 2005 03:32PM
2061
October 15, 2005 06:39PM
2016
October 16, 2005 01:07AM
1869
October 16, 2005 09:32AM
1990
October 16, 2005 06:06PM
1922
October 17, 2005 07:19PM
Re: weird error in my JDBC code
1897
October 18, 2005 05:47PM
1966
October 18, 2005 07:42PM
1959
October 19, 2005 01:56AM
1901
October 19, 2005 01:55AM
1916
October 19, 2005 07:01AM
1961
October 19, 2005 07:04AM
1851
October 19, 2005 08:54PM
1856
October 20, 2005 01:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.