Code example for PreparedStatement

Methods: executeQuery, setString

0
    try 
    { 
      // Query to see if  user attribute information exists for this user type 
      stmt = con.prepareStatement("SELECT 1 FROM ALL_TYPE_ATTRS " +
                                    "WHERE OWNER=? AND TYPE_NAME=? AND ROWNUM < 2"); 
      stmt.setString(1, ownerName);
      stmt.setString(2, typeName);
      rs = stmt.executeQuery();
 
      // If a row exists then this is a user type 
      return rs.next();
    } 
    finally 
    { 
      SchemaUtils.close(rs);
      SchemaUtils.close(stmt);
    } 
  } 
 
  public UserTypeInfo buildUserTypeInfo(Connection con, String typeOwner, String typeName)
      throws SQLException