Package java.sql

Examples of java.sql.CallableStatement.execute()


        cStmt.setTimestamp(5, new Timestamp(pubDate.getTime()));
      }else{
        cStmt.setTimestamp(5, null);
      }
      cStmt.registerOutParameter(6,Types.INTEGER);
      cStmt.execute();
      id = cStmt.getInt(6);
    } catch (Exception e) {
      logger.fatal(e);
    } finally{
      try {
View Full Code Here


    Connection conn = null;
    try{           
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("call findAutoImportSubscription(?);");     
      cStmt.setInt(1,ageHour);
      cStmt.execute();
      ResultSet rs = cStmt.executeQuery();
      while(rs.next()){
        FeedSubscription feed = createFeedSubscriptionObject(rs);       
        feeds.add(feed);
      }   
View Full Code Here

      cStmt.setString(3,user.getFullname());
      cStmt.setString(4,user.getEmail());
      cStmt.setTimestamp(5,new Timestamp(user.getCreatedOn().getTime()));
      cStmt.setInt(6,user.getAccountStatus());
      cStmt.registerOutParameter(7,Types.INTEGER);
      cStmt.execute();
      userId = cStmt.getInt(7);
    }catch(Exception e){
      logger.error(e);
    }finally{
      try {     
View Full Code Here

      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createLink(?,?,?)}");
      cStmt.setString(1,link.getUrl());
      cStmt.setInt(2,link.getMimeTypeId());
      cStmt.registerOutParameter(3,Types.INTEGER);
      cStmt.execute();
      id = cStmt.getInt(3);
    } catch (Exception e) {
      logger.fatal(e);
    } finally{
      try {
View Full Code Here

      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call hasForUser(?,?,?)}");
      cStmt.setInt(1,bookmark.getId());
      cStmt.setInt(2,user.getId());
      cStmt.registerOutParameter(3,Types.INTEGER);
      cStmt.execute();
      count = cStmt.getInt(3);
      if (count > 0) found = true;
    } catch (Exception e) {
      logger.fatal(e);
    } finally{
View Full Code Here

    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call getForUserCount(?,?)}");
      cStmt.setInt(1, user.getId());
      cStmt.registerOutParameter(2,Types.INTEGER);
      cStmt.execute();
      count = cStmt.getInt(2);
    } catch (Exception e) {
      logger.fatal(e);
    } finally{
      try {
View Full Code Here

      cStmt = conn.prepareCall("{call getForUserInTimeRangeCount(?,?,?,?)}");
      cStmt.setInt(1, user.getId());
      cStmt.setTimestamp(2,new Timestamp(start.getTime()));
      cStmt.setTimestamp(3,new Timestamp(end.getTime()));
      cStmt.registerOutParameter(4,Types.INTEGER);
      cStmt.execute();
      count = cStmt.getInt(4);
    } catch (Exception e) {
      logger.fatal(e);
    } finally{
      try {
View Full Code Here

      cStmt.setInt(1,folder.getUser().getId());
      cStmt.setString(2,folder.getName());
      cStmt.setString(3,folder.getDescription());
      cStmt.setTimestamp(4,new Timestamp(folder.getLastUpdated().getTime()));
      cStmt.registerOutParameter(5,Types.INTEGER);
      cStmt.execute();
      id = cStmt.getInt(5);
    } catch (Exception e) {
      logger.fatal(e);
    } finally{
      try {
View Full Code Here

        sSQL = "{call k_sp_count_thread_msgs(?,?)}";
        if (DebugFile.trace) DebugFile.writeln("CallableStatement.prepareCall(" + sSQL + ")");
        oCall = oConn.prepareCall(sSQL);
        oCall.setString(1, getString(DB.gu_thread_msg));
        oCall.registerOutParameter(2, Types.INTEGER);
        oCall.execute();
        nThreadMsgs = oCall.getInt(2);
        oCall.close();
    }

    if (bNewMsg) replace(DB.nu_thread_msgs, ++nThreadMsgs);
View Full Code Here

    } // fi

    sSQL = "{ call k_sp_del_newsmsg ('" + getString(DB.gu_msg) + "') }";
    if (DebugFile.trace) DebugFile.writeln("Connection.prepareCall(" + sSQL + ")");
    oCall = oConn.prepareCall(sSQL);
    oCall.execute();
    oCall.close();

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End NewsMessage.delete() : true");
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.