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.