Class Hierarchy        Index

Class COM.cloudscape.vti.ExternalQuery

java.lang.Object
   |
   +----COM.cloudscape.vti.VTITemplate
           |
           +----COM.cloudscape.vti.ExternalQuery

public class ExternalQuery
extends VTITemplate
Copyright © 1998-1999 Cloudscape, Inc. All rights reserved.

Use of VirtualTableInterface to create an ExternalVirtualTable from a JDBC query.

This class can be used in a FROM clause to get query results from any JDBC source. For example:

SELECT city, state
FROM new ExternalQuery('jdbc:cloudscape:zipdb',
'SELECT city, state FROM ZipCodeMap WHERE zip=94612') AS Z
ExternalQuery objects can be used in joins, but since access to ExternalVirtualTables is not optimized, their use in performance sensitive queries must be hand-tuned.

Notes about this implementation:

This class implements only JDBC 1.2, not JDBC 2.0. You cannot compile this class with JDK1.2, since it implements only the JDBC 1.2 ResultSet interface and not the JDBC 2.0 ResultSet interface. You can only use this class in a JDK 1.2 runtime environment if no JDBC 2.0 calls are made against it.


Constructor Index

 o ExternalQuery(String, String)
Create a ResultSet based on a JDBC URL and a query.

Method Index

 o clearWarnings()
 o close()
 o findColumn(String)
 o getAsciiStream(int)
 o getAsciiStream(String)
 o getBigDecimal(int, int)
 o getBigDecimal(String, int)
 o getBinaryStream(int)
 o getBinaryStream(String)
 o getBoolean(int)
 o getBoolean(String)
 o getByte(int)
 o getByte(String)
 o getBytes(int)
 o getBytes(String)
 o getCursorName()
 o getDate(int)
 o getDate(String)
 o getDouble(int)
 o getDouble(String)
 o getFloat(int)
 o getFloat(String)
 o getInt(int)
 o getInt(String)
 o getLong(int)
 o getLong(String)
 o getMetaData()
 o getObject(int)
 o getObject(String)
 o getResultSetMetaData(String, String)
For the Virtual Table Interface, provide the metadata for a given query.
 o getShort(int)
 o getShort(String)
 o getString(int)
 o getString(String)
 o getTime(int)
 o getTime(String)
 o getTimestamp(int)
 o getTimestamp(String)
 o getUnicodeStream(int)
 o getUnicodeStream(String)
 o getWarnings()
 o next()
 o wasNull()

Constructors

 o ExternalQuery
 public ExternalQuery(String jdbcUrl,
                      String query) throws SQLException
Create a ResultSet based on a JDBC URL and a query.

Parameters:
jdbcUrl - the connection URL.
query - the query to execute.
Throws: SQLException
thrown by JDBC calls

Methods

 o getResultSetMetaData
 public static ResultSetMetaData getResultSetMetaData(String jdbcUrl,
                                                      String query) throws SQLException
For the Virtual Table Interface, provide the metadata for a given query.

Parameters:
jdbcUrl - the connection URL.
query - the query to execute.
Returns:
the result set metadata for the query
Throws: SQLException
thrown by JDBC calls
 o next
 public boolean next() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
next in class VTITemplate
See Also:
ResultSet
 o close
 public void close() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
close in class VTITemplate
See Also:
ResultSet
 o wasNull
 public boolean wasNull() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
wasNull in class VTITemplate
See Also:
ResultSet
 o getString
 public String getString(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getString in class VTITemplate
See Also:
ResultSet
 o getBoolean
 public boolean getBoolean(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBoolean in class VTITemplate
See Also:
ResultSet
 o getByte
 public byte getByte(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getByte in class VTITemplate
See Also:
ResultSet
 o getShort
 public short getShort(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getShort in class VTITemplate
See Also:
ResultSet
 o getInt
 public int getInt(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getInt in class VTITemplate
See Also:
ResultSet
 o getLong
 public long getLong(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getLong in class VTITemplate
See Also:
ResultSet
 o getFloat
 public float getFloat(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getFloat in class VTITemplate
See Also:
ResultSet
 o getDouble
 public double getDouble(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getDouble in class VTITemplate
See Also:
ResultSet
 o getBigDecimal
 public BigDecimal getBigDecimal(int columnIndex,
                                 int scale) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBigDecimal in class VTITemplate
See Also:
ResultSet
 o getBytes
 public byte[] getBytes(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBytes in class VTITemplate
See Also:
ResultSet
 o getDate
 public Date getDate(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getDate in class VTITemplate
See Also:
ResultSet
 o getTime
 public Time getTime(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getTime in class VTITemplate
See Also:
ResultSet
 o getTimestamp
 public Timestamp getTimestamp(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getTimestamp in class VTITemplate
See Also:
ResultSet
 o getAsciiStream
 public InputStream getAsciiStream(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getAsciiStream in class VTITemplate
See Also:
ResultSet
 o getUnicodeStream
 public InputStream getUnicodeStream(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getUnicodeStream in class VTITemplate
See Also:
ResultSet
 o getBinaryStream
 public InputStream getBinaryStream(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBinaryStream in class VTITemplate
See Also:
ResultSet
 o getString
 public String getString(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getString in class VTITemplate
See Also:
ResultSet
 o getBoolean
 public boolean getBoolean(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBoolean in class VTITemplate
See Also:
ResultSet
 o getByte
 public byte getByte(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getByte in class VTITemplate
See Also:
ResultSet
 o getShort
 public short getShort(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getShort in class VTITemplate
See Also:
ResultSet
 o getInt
 public int getInt(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getInt in class VTITemplate
See Also:
ResultSet
 o getLong
 public long getLong(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getLong in class VTITemplate
See Also:
ResultSet
 o getFloat
 public float getFloat(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getFloat in class VTITemplate
See Also:
ResultSet
 o getDouble
 public double getDouble(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getDouble in class VTITemplate
See Also:
ResultSet
 o getBigDecimal
 public BigDecimal getBigDecimal(String columnName,
                                 int scale) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBigDecimal in class VTITemplate
See Also:
ResultSet
 o getBytes
 public byte[] getBytes(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBytes in class VTITemplate
See Also:
ResultSet
 o getDate
 public Date getDate(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getDate in class VTITemplate
See Also:
ResultSet
 o getTime
 public Time getTime(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getTime in class VTITemplate
See Also:
ResultSet
 o getTimestamp
 public Timestamp getTimestamp(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getTimestamp in class VTITemplate
See Also:
ResultSet
 o getAsciiStream
 public InputStream getAsciiStream(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getAsciiStream in class VTITemplate
See Also:
ResultSet
 o getUnicodeStream
 public InputStream getUnicodeStream(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getUnicodeStream in class VTITemplate
See Also:
ResultSet
 o getBinaryStream
 public InputStream getBinaryStream(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getBinaryStream in class VTITemplate
See Also:
ResultSet
 o getWarnings
 public SQLWarning getWarnings() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getWarnings in class VTITemplate
See Also:
ResultSet
 o clearWarnings
 public void clearWarnings() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
clearWarnings in class VTITemplate
See Also:
ResultSet
 o getCursorName
 public String getCursorName() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getCursorName in class VTITemplate
See Also:
ResultSet
 o getMetaData
 public ResultSetMetaData getMetaData() throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getMetaData in class VTITemplate
See Also:
ResultSet
 o getObject
 public Object getObject(int columnIndex) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getObject in class VTITemplate
See Also:
ResultSet
 o getObject
 public Object getObject(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
getObject in class VTITemplate
See Also:
ResultSet
 o findColumn
 public int findColumn(String columnName) throws SQLException
Throws: SQLException
on unexpected JDBC error
Overrides:
findColumn in class VTITemplate
See Also:
ResultSet

  Class Hierarchy        Index