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

    Default Passing DateTime in java to mysql Stored Procedure

    does anyone knows it?:(
    :cool:

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    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, 11:48 AM
  2. How to call Oracle stored procedure from Java?
    By parag_narkhede in forum New To Java
    Replies: 4
    Last Post: 10-07-2009, 07:50 AM
  3. Replies: 2
    Last Post: 01-30-2009, 12:53 PM
  4. stored procedure
    By sankarigopi in forum JDBC
    Replies: 1
    Last Post: 11-13-2008, 04:53 PM
  5. How to get multiple rows from Stored Procedure
    By SRJ1957 in forum Advanced Java
    Replies: 0
    Last Post: 08-11-2008, 08: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
  •