Results 1 to 2 of 2
  1. #1
    ashin is offline Member
    Join Date
    Nov 2008
    Rep Power

    Default Passing DateTime in java to mysql Stored Procedure

    does anyone knows it?:(

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    i believe this is done with a callable statement, where you bind the value as a java.sql.Timestamp

    Java Code:
     CallableStatement stmt = con.prepareCall("{ exec myStoredProcedure(?) }");  // i think thats the callable kind of sql format ?
     stmt.setTimestamp(1, myDateTimeValue); // where you might need to convert a java.util.Date to a java.util.Timestamp here
     // and then other parameters, if any, then invoke the call

Similar Threads

  1. Debug mySql stored procedure
    By ulix83 in forum NetBeans
    Replies: 0
    Last Post: 10-29-2009, 12:48 PM
  2. How to call Oracle stored procedure from Java?
    By parag_narkhede in forum New To Java
    Replies: 4
    Last Post: 10-07-2009, 08:50 AM
  3. Replies: 2
    Last Post: 01-30-2009, 01:53 PM
  4. stored procedure
    By sankarigopi in forum JDBC
    Replies: 1
    Last Post: 11-13-2008, 05:53 PM
  5. How to get multiple rows from Stored Procedure
    By SRJ1957 in forum Advanced Java
    Replies: 0
    Last Post: 08-11-2008, 09:26 PM

Posting Permissions

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