Code example for PreparedStatement

Methods: executeQuery, setString

0
    try 
    { 
      // Query to see if  collection type information exists for this collection type 
      stmt = con.prepareStatement("SELECT 1 FROM ALL_COLL_TYPES " +
                                      "WHERE OWNER=? AND TYPE_NAME=? AND ROWNUM < 2"); 
      stmt.setString(1, ownerName);
      stmt.setString(2, typeName);
      rs = stmt.executeQuery();
 
      // If collection information exists then it is a collection type 
      return rs.next();
    } 
    finally 
    { 
      SchemaUtils.close(rs);
      SchemaUtils.close(stmt);
    } 
  } 
 
  public CollectionTypeInfo buildCollectionTypeInfo(Connection con,
                                                    String ownerName,