Code example for Connection

Methods: prepareStatement

0
		PreparedStatement stmt = null;
		ResultSet rs = null;
		long numRecords = -1;
		try 
		{ 
			stmt = _conn.prepareStatement(sql);
			rs = stmt.executeQuery();
			if (rs.next())
			{ 
				numRecords = rs.getLong(1);
			} 
		} catch ( SQLException sqlEx) {
		    LOG.error("getNumRecords() error: " + sqlEx.getMessage(), sqlEx);
		} finally { 
			DBHelper.close(rs,stmt,null);
		} 
		return numRecords;
	} 
 
  /** 
   *