Examples of prepareCall()


Examples of java.sql.Connection.prepareCall()

    CallableStatement cStmt = null;
    Connection conn = null;
    int userId = -1;
    try{
      conn = datasource.getConnection();
      cStmt = conn.prepareCall("{call createUser(?,?,?,?,?,?,?)}");
      cStmt.setString(1,user.getUsername());
      cStmt.setString(2,user.getPassword());
      cStmt.setString(3,user.getFullname());
      cStmt.setString(4,user.getEmail());
      cStmt.setTimestamp(5,new Timestamp(user.getCreatedOn().getTime()));
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      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);
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createForUser(?,?,?,?,?)}");
      cStmt.setInt(1,forUser.getForUser().getId());
      cStmt.setInt(2,forUser.getBookmark().getId());
      cStmt.setString(3,forUser.getMessage());
      cStmt.setTimestamp(4,new Timestamp(forUser.getCreatedOn().getTime()));
      cStmt.registerOutParameter(5,Types.INTEGER);
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    int count = 0;
    try {
      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);
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    Integer count = null;
    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) {
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    Integer count = null;
    try {
      conn = dataSource.getConnection();
      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();
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement stmt = null;
    boolean deleted = false;
    try {
      conn = dataSource.getConnection();
      stmt = conn.prepareCall("call deleteForUserById(?,?)");
      for(int id : ids){
        stmt.setInt(1,user.getId());
        stmt.setInt(2,id);
        stmt.addBatch();
      }
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    DaoResult<ForUser> result = null;
    CallableStatement cStmt = null;
    Connection conn = null;
    try{           
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("call pageForUserBySenderId(?,?,?,?,?);");
      cStmt.setInt(1,user.getId());
      cStmt.setInt(2,sender.getId());
      cStmt.setInt(3,offset);
      cStmt.setInt(4,count);     
      cStmt.registerOutParameter(5,Types.INTEGER);     
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    boolean[] opOkay = new boolean[bookmarks.size()];
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call addBookmarkToFolder(?,?,?)};");
      Timestamp tsmp = new Timestamp(timestamp.getTime());
      for(Bookmark bm : bookmarks){
        cStmt.setInt(1,folder.getId());
        cStmt.setInt(2,bm.getId());
        cStmt.setTimestamp(3,tsmp);
View Full Code Here

Examples of java.sql.Connection.prepareCall()

    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createFolder(?,?,?,?,?)}");
      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);
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.