Code example for PreparedStatement

Methods: execute, setLong, setString

0
		 
        Transaction txn = Transaction.currentTxn();
        PreparedStatement pstmt = null;
        try { 
            pstmt = txn.prepareAutoCloseStatement(sql);
            pstmt.setString(1, syncObjType);
            pstmt.setLong(2, syncObjId);
            pstmt.setString(3, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), dt));
            pstmt.setString(4, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), dt));
            pstmt.execute();
        } catch (SQLException e) {
        	s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":" + e.getMessage(), e);
        } catch (Throwable e) {
        	s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":" + e.getMessage(), e);
        } 
	} 
	 
	@Override 
	public SyncQueueVO find(String syncObjType, long syncObjId) {
    	SearchCriteria<SyncQueueVO> sc = TypeIdSearch.create();
    	sc.setParameters("syncObjType", syncObjType);