Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    9

    Unanswered: Stored Procedure Problem

    hi
    I have added a stored procedure in mySQL database. that stored funstion just gets the input integer and gives with adding number 10.When I execute in mySQL promt that works fine. I tried Java code to get the output. Here is the code. Here i got Exception like 'CallableStatements not Supported' . I dont know what is the problme here. Help me..


    import java.sql.*;
    import java.io.*;

    public class proc
    {
    public static void main(String a[])
    {
    try
    {

    Class.forName("org.gjt.mm.mysql.Driver");
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/jobsearch?user=root&password=");
    CallableStatement cs = con.prepareCall("{? = call pr(?)}");


    cs.registerOutParameter(1,Types.INTEGER);
    cs.setInt(1,5);

    cs.execute();

    System.out.println(cs.getInt(1));


    } catch(Exception e){ System.out.println(e);}



    }
    }

  2. #2
    Join Date
    May 2004
    Posts
    45
    Have you got a recent MySQL Driver? Since you're using stored procedures you must be using MySQL 5. I don't know if the most recent version of the driver supports 5's new features but that would be a place to start.
    Keith Brownlow
    ServerMetrics DB Monitoring (www.servermetrics.com)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •