Package java.sql

Examples of java.sql.Connection.prepareCall()


    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createLinkTag(?,?,?,?)}");
      cStmt.setInt(1,tag.getLink().getId());
      cStmt.setInt(2,tag.getTag().getId());
      cStmt.setInt(3,tag.getCount());
      cStmt.registerOutParameter(4,Types.INTEGER);
      cStmt.execute();
View Full Code Here


    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createTag(?,?,?)}");
      cStmt.setString(1,tag.getLabel());
      cStmt.setInt(2,tag.getCount());
      cStmt.registerOutParameter(3,Types.INTEGER);
      cStmt.execute();
      id = cStmt.getInt(3);
View Full Code Here

    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createUserTag(?,?,?,?)}");
      cStmt.setInt(1,tag.getUser().getId());
      cStmt.setInt(2,tag.getTag().getId());
      cStmt.setInt(3,tag.getCount());
      cStmt.registerOutParameter(4,Types.INTEGER);
      cStmt.execute();
View Full Code Here

    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createBookmarkTag(?,?,?,?,?)}");
      cStmt.setInt(1,tag.getBookmark().getId());
      cStmt.setInt(2,tag.getTag().getId());     
      cStmt.setInt(3,tag.getCount());
      cStmt.setInt(4,tag.getPosition());
      cStmt.registerOutParameter(5,Types.INTEGER);
View Full Code Here

    Connection conn = null;
    CallableStatement stmt = null;
    boolean[] opOkay = new boolean[tags.length];
    try {
      conn = dataSource.getConnection();
      stmt = conn.prepareCall("call addTagCountOne(?,?,?,?)");
      for(Tag tag : tags){
        stmt.setInt(1,tag.getId());
        stmt.setInt(2,user.getId());
        stmt.setInt(3,link.getId());
        stmt.setInt(4,bookmark.getId());
View Full Code Here

    Connection conn = null;
    CallableStatement stmt = null;
    boolean[] opOkay = new boolean[tags.length];
    try {
      conn = dataSource.getConnection();
      stmt = conn.prepareCall("call subtractTagCountOne(?,?,?,?)");
      for(Tag tag: tags){
        stmt.setInt(1,tag.getId());
        stmt.setInt(2,user.getId());
        stmt.setInt(3,link.getId());
        stmt.setInt(4,bookmark.getId());
View Full Code Here

    CallableStatement stmt = null;
    List<Bookmark> changedBookmarks = new ArrayList<Bookmark>();
    try {
      ResultSet rs = null;
      conn = dataSource.getConnection();     
      stmt = conn.prepareCall("call expandTag(?,?,?)");
      for(Tag t : toTags){
        stmt.setInt(1,fromTag.getId());
        stmt.setInt(2,t.getId());
        stmt.setInt(3,user.getId());
        rs = stmt.executeQuery();
View Full Code Here

    CallableStatement stmt = null;
    List<Bookmark> changeBookmarks = new ArrayList<Bookmark>();
    try {
      ResultSet rs = null;
      conn = dataSource.getConnection();
      stmt = conn.prepareCall("call reduceTag(?,?)");
      for(Tag t : tags){
        stmt.setInt(1,t.getId());
        stmt.setInt(2,user.getId());
        rs = stmt.executeQuery();
      }     
View Full Code Here

    List<LinkTag> tags = new ArrayList<LinkTag>();
    CallableStatement stmt = null;
    Connection conn = null;
    try{
      conn = dataSource.getConnection();
      stmt = conn.prepareCall("call pageLinkTagSortByFreq(?,?,?,?)");
      stmt.setInt(1,link.getId());
      stmt.setInt(2,offset);
      stmt.setInt(3,count);
      stmt.registerOutParameter(4,Types.INTEGER);
      ResultSet rs = stmt.executeQuery();
View Full Code Here

    Connection conn = null;
    CallableStatement cStmt = null;
    int id = -1;
    try {
      conn = dataSource.getConnection();
      cStmt = conn.prepareCall("{call createTagAssertion(?,?,?,?,?)}");
      cStmt.setLong(1,asrt.getSubject().getId());
      cStmt.setLong(2,asrt.getProperty().getId());
      cStmt.setLong(3,asrt.getObject().getId());
      cStmt.setLong(4,asrt.getUser().getId());
      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.