Package java.sql

Examples of java.sql.CallableStatement.addBatch()


        stat = conn.createStatement();
        stat.execute("CREATE ALIAS updatePrices FOR \"" + getClass().getName() + ".updatePrices\"");
        CallableStatement call = conn.prepareCall("{call updatePrices(?, ?)}");
        call.setString(1, "Hello");
        call.setFloat(2, 1.4f);
        call.addBatch();
        call.setString(1, "World");
        call.setFloat(2, 3.2f);
        call.addBatch();
        int[] updateCounts = call.executeBatch();
        int total = 0;
View Full Code Here


        call.setString(1, "Hello");
        call.setFloat(2, 1.4f);
        call.addBatch();
        call.setString(1, "World");
        call.setFloat(2, 3.2f);
        call.addBatch();
        int[] updateCounts = call.executeBatch();
        int total = 0;
        for (int t : updateCounts) {
            total += t;
        }
View Full Code Here

      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call addImportFolder(?,?)};");     
      for(Folder folder : folders){
        cStmt.setInt(1,subscription.getId());
        cStmt.setInt(2,folder.getId());       
        cStmt.addBatch();       
      }     
      int result[] = cStmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] >= 0 ){
          numUpdated++;
View Full Code Here

      cstmt = conn.prepareCall("call removeImportFolder(?,?)");
      int feedId = subscription.getId();   
      for(Folder folder : folders){
        cstmt.setInt(1,feedId);
        cstmt.setInt(2,folder.getId());       
        cstmt.addBatch();
      }
      int result[] = cstmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] > 0){
          numUpdated++;         
View Full Code Here

      conn = dataSource.getConnection();
      stmt = conn.prepareCall("call deleteForUserById(?,?)");
      for(int id : ids){
        stmt.setInt(1,user.getId());
        stmt.setInt(2,id);
        stmt.addBatch();
      }
      stmt.executeBatch();
      return true;
    } catch (SQLException e) {
      logger.fatal(e);
View Full Code Here

      Timestamp tsmp = new Timestamp(timestamp.getTime());
      for(Bookmark bm : bookmarks){
        cStmt.setInt(1,folder.getId());
        cStmt.setInt(2,bm.getId());
        cStmt.setTimestamp(3,tsmp);
        cStmt.addBatch();       
      }     
      int result[] = cStmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] >= 0 ){
          opOkay[i] = true;
View Full Code Here

      cstmt = conn.prepareCall("call removeBookmarkFromFolder(?,?)");
      int folderId = folder.getId();   
      for(Bookmark bm : bookmarks){
        cstmt.setInt(1,folderId);
        cstmt.setInt(2,bm.getId());       
        cstmt.addBatch();
      }
      int result[] = cstmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] >= 0){
          opOkay[i] = true;
View Full Code Here

      for(Tag tag : tags){
        stmt.setInt(1,tag.getId());
        stmt.setInt(2,user.getId());
        stmt.setInt(3,link.getId());
        stmt.setInt(4,bookmark.getId());
        stmt.addBatch();
      }
      int result[] = stmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] >= 0){
          opOkay[i] = true;
View Full Code Here

      for(Tag tag: tags){
        stmt.setInt(1,tag.getId());
        stmt.setInt(2,user.getId());
        stmt.setInt(3,link.getId());
        stmt.setInt(4,bookmark.getId());
        stmt.addBatch();
      }   
      int result[] = stmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] >= 0){
          opOkay[i] = true;
View Full Code Here

      int subjectTagId = subjectTag.getId();
      for(int i = 0; i < objectTag.length; i++){
        cstmt.setInt(1,userId);
        cstmt.setInt(2,subjectTagId);
        cstmt.setInt(3,objectTag[i].getId());
        cstmt.addBatch();
      }
      int result[] = cstmt.executeBatch();
      for(int i = 0; i < result.length; i++){
        if(result[i] < 0){
          isOkay = false;
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.