Package java.sql

Examples of java.sql.PreparedStatement.clearParameters()


                              if (rs2.next()) {
                                  // There is a row for this user's template user...
                                  sql = "INSERT INTO UP_USER_LAYOUT (USER_ID, LAYOUT_ID, LAYOUT_TITLE, INIT_STRUCT_ID) VALUES (?,?,?,?)";
                                  PreparedStatement pstmt3 = con.prepareStatement(sql);
                                  try {
                                      pstmt3.clearParameters();
                                      pstmt3.setInt(1, userId);
                                      pstmt3.setInt(2, rs2.getInt("LAYOUT_ID"));
                                      pstmt3.setString(3, rs2.getString("LAYOUT_TITLE"));
                                      pstmt3.setInt(4, rs2.getInt("INIT_STRUCT_ID"));
                                      if (log.isDebugEnabled())
View Full Code Here


                              } else {
                                  // We can't rely on the template user, but we still need a row...
                                  sql = "INSERT INTO UP_USER_LAYOUT (USER_ID, LAYOUT_ID, LAYOUT_TITLE, INIT_STRUCT_ID) VALUES (?,?,?,?)";
                                  PreparedStatement pstmt3 = con.prepareStatement(sql);
                                  try {
                                      pstmt3.clearParameters();
                                      pstmt3.setInt(1, userId);
                                      pstmt3.setInt(2, layoutId);
                                      pstmt3.setString(3, "default layout");
                                      pstmt3.setInt(4, 1);
                                      if (log.isDebugEnabled())
View Full Code Here

                  try {
                      while (rs.next()) {
                          sql = "INSERT INTO UP_SS_USER_PARM (USER_ID, PROFILE_ID, SS_ID, SS_TYPE, PARAM_NAME, PARAM_VAL) VALUES(?,?,?,?,?,?)";
                          PreparedStatement pstmt2 = con.prepareStatement(sql);
                          try {
                              pstmt2.clearParameters();
                              pstmt2.setInt(1, userId);
                              pstmt2.setInt(2, rs.getInt("PROFILE_ID"));
                              pstmt2.setInt(3, rs.getInt("SS_ID"));
                              pstmt2.setInt(4, rs.getInt("SS_TYPE"));
                              pstmt2.setString(5, rs.getString("PARAM_NAME"));
View Full Code Here

    {
        String sql = getCountAMemberEntitySql();
        PreparedStatement ps = conn.prepareStatement(sql);
        try
        {
            ps.clearParameters();
            ps.setString(1, groupKey);
            ps.setString(2, memberKey);
            if (log.isDebugEnabled())
                log.debug(
                        "RDBMEntityGroupStore.containsEntity(): " + ps +
View Full Code Here

    {
        String sql = getCountAMemberGroupSql();
        PreparedStatement ps = conn.prepareStatement(sql);
        try
        {
            ps.clearParameters();
            ps.setString(1, groupKey);
            ps.setString(2, memberKey);
            ps.setString(3, memberService);
            if (log.isDebugEnabled())
                log.debug(
View Full Code Here

    {
        String sql = getCountMemberGroupsNamedSql();
        PreparedStatement ps = conn.prepareStatement(sql);
        try
        {
            ps.clearParameters();
            ps.setString(1, groupKey);
            ps.setString(2, memberName);
            ps.setString(3, service);
            if (log.isDebugEnabled())
                log.debug(
View Full Code Here

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

  
   public PreparedStatement getStatement(int id)
      throws SQLException
   {
      PreparedStatement statement = statements.get(id);
      statement.clearParameters();
      return statement;
   }
  
   public void addStatement(int id,String sql)
      throws SQLException
View Full Code Here

        while (importer.next()) {
          rows++;
          if (inputLines > 0) {
            ProgressBarDialog.incrementBar(1);
          }
          stmt.clearParameters();
          int i = 1;
          for (TableColumnInfo column : columns) {
            String mapping = getMapping(column);
            try {
              if (SpecialColumnMapping.SKIP.getVisibleString().equals(mapping)) {
View Full Code Here

                // MySQL driver gets unhappy when we use the same
                // PreparedStatement to bind null and non-null LOB variables
                // without clearing the parameters first.
                if (isMysql && foundLOBType)
                {
                    insertStmt.clearParameters();
                }
                StringBuilder lastStmtValuesBuffer = new StringBuilder();
                lastStmtValuesBuffer.append("\n(Bind variable values: ");
                for (int i = 0; i < columnCount; i++) {
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.