BBjRecordSet::getJDBCResultSet

Description

In BBj 9.0 and higher, this method  returns a java.sql.ResultSet object containing all of the data in the BBjRecordSet.  

Syntax

Return Value

Method

java.sql.ResultSet

getJDBCResultSet()

Parameters

None.

Return Value

Returns a java.sql.ResultSet object representing the contents of the BBjRecordSet.

Remarks

The returned ResultSet can be used as any JDBC ResultSet and therefore has all of the ResultSet interface methods available. This method only returns values for SQLRecordSet and MemoryRecordSet; using it on a FileRecordSet will result in an !ERROR=80.

Example

REM ' createSQLRecordSet sample

REM ' Define the connection information
database$ = "ChileCompany"
table$ = "ITEM"
user$="admin"
password$="admin123"
modes$="user="+user$+",password="+password$
select$ = "select * from "+table$

REM ' Create the RecordSet
RecordSet! = BBJAPI().createSQLRecordSet(database$,modes$,select$)

REM ' Get the Java JDBC java.sql.ResultSet for the underlying data.
jdbcRs! = RecordSet!.getJDBCResultSet()

REM ' Get access to the ResultSetMetaData to get extra info not available from BBj normally
meta! = jdbcRs!.getMetaData()

REM ' Show the number of columns in the SELECT statement

print "There are " + str(meta!.getColumnCount()) + " columns in the query."

print "Query item " + meta!.getColumnName(1) + " is of type " + meta!.getColumnTypeName(1)

See Also

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.