Package java.sql

Examples of java.sql.PreparedStatement.clearParameters()


                        if (!rset.next()) {
                            throw new SQLException("Problem in retrieving autogenerated keys");
                        }

                        pstmt.clearParameters();
                        //System.out.println("Inserted parameter [name=" + key + ", value=" + value + "]");
                        logger.debug("Inserted parameter [name=" + key + ", value=" + value + "]");
                    }
                }
            }
View Full Code Here


            s = "insert into bintest values ( ?, ?)";

            PreparedStatement p = connection.prepareStatement(s);

            p.clearParameters();
            p.setInt(1, 10);
            p.setBytes(2, b1);
            p.executeUpdate();
            p.clearParameters();
            p.setInt(1, 20);
View Full Code Here

            p.clearParameters();
            p.setInt(1, 10);
            p.setBytes(2, b1);
            p.executeUpdate();
            p.clearParameters();
            p.setInt(1, 20);
            p.setBytes(2, b2);
            p.executeUpdate();

            byte[] b1n;
View Full Code Here

                1, 2, 3
            };

            p.setObject(2, ia1);
            p.executeUpdate();
            p.clearParameters();
            p.setInt(1, 2);

            java.awt.Rectangle r1 = new java.awt.Rectangle(10, 11, 12, 13);

            p.setObject(2, r1);
View Full Code Here

    //U.log("prepareStatement: " + sql);
    PreparedStatement ps = stmts.get(sql);
    if (ps != null) {
      //U.log("  found.");
          try {
              ps.clearParameters(); // checks that it's ok
              return ps;
          } catch (Exception e) {
              //U.log(e, "Reprepare statement : " + sql);
          }
    }
View Full Code Here

        int sqlStep = PREPARING;
        try {
            PreparedStatement statement = connection.prepareStatement(query);

            sqlStep = SETTING_PARAMS;
            statement.clearParameters();
            for (int i = 0; i < parameterValues.length; i++)
                statement.setObject(i + 1, parameterValues[i]);

            sqlStep = EXECUTING;
            ResultSet results = statement.executeQuery();
View Full Code Here

                }
            } finally {
                _batchedSql = null;
                batchedRows.clear();
                if (ps != null) {
                    ps.clearParameters();
                    try {
                        ps.close();
                    } catch (SQLException sqex) {
                        throw SQLExceptions.getStore(sqex, ps, _dict);
                    }
View Full Code Here

      } else {
        pstmt = conn.prepareStatement(getQuery());
      }
      preparedStatementMap.put(getQuery(), pstmt);
    }
    pstmt.clearParameters();
    return pstmt;
  }

  private static void closeAllStatements(Collection collection) {
    Iterator iterator = collection.iterator();
View Full Code Here

            ps.setString(2,query);
            rs = ps.executeQuery();
            //System.out.println(ps.toString());
            while (rs.next()){
              //System.out.println("result");
              uis.clearParameters();
              uis.setString(1,rs.getString(1));
              urs = uis.executeQuery();
              if(urs.next()){
                ar.add(new EntityIdentifier(urs.getString(1),personDef));
              }
View Full Code Here

                break;
              default:
                throw new GroupsException("Unknown search type");
            }
            try {
              ps.clearParameters();
              ps.setString(1,query);
              ps.setString(2,query);
              ResultSet rs = ps.executeQuery();
              try {
                //System.out.println(ps.toString());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.