Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4271330

Need PreparedStatement.toString() for viewing current prepared SQL statement

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2
    • core-libs
    • generic
    • generic



      Name: skT88420 Date: 09/13/99


      Would like a toString method in the java.sql.PreparedStatement class so that I can see what the current completely prepared statement is that is being sent to the DB as SQL. As an example, given:

      PreparedStatement ps = new PreparedStatement("Select * from Table1 where ? > ?");
      ps.setString(1,"ID");
      ps.setInt(2,"1000");

      There is for me and apparently several other programmers (as this request was put on newsgroup comp.lang.java.databases, a need to have a toString method in PreparedStatement that would return the string that would be sent to the database. This would be helpfull for debugging purposes. Please let me know of any existing class or method that would be helpful here, or please consider adding such a toString method to PreparedStatement in the next release of JDBC.
      Mark Rines, ###@###.###
      (Review ID: 95190)
      ======================================================================

            jellissunw Jon Ellis (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: