skip to main content
Using the Driver : ResultSet Metadata Support

Try DataDirect Drivers Now

ResultSet Metadata Support

If your application requires table name information, the driver can return table name information in ResultSet metadata for Select statements. The Select statements for which ResultSet metadata is returned may contain aliases, joins, and fully qualified names. The following queries are examples of Select statements for which the ResultSetMetaData.getTableName() method returns the correct table name for columns in the Select list:
SELECT id, name FROM Employee
SELECT, AS EmployeeName FROM Employee E
SELECT,, I.location, FROM Employee E, EmployeeInfo I
   WHERE =
SELECT id, name, location, phone FROM Employee, EmployeeInfo WHERE id = empId
SELECT,, EmployeeInfo.location,
   FROM Employee, EmployeeInfo WHERE =
The table name returned by the driver for generated columns is an empty string. The following query is an example of a Select statement that returns a result set that contains a generated column (the column named "upper").
SELECT, as EmployeeName, {fn UCASE(} AS upper
   FROM Employee E
The driver also can return catalog name information when the ResultSetMetaData.getCatalogName() method is called if the driver can determine that information. For example, for the following statement, the driver returns "test" for the catalog name and "foo" for the table name:
The additional processing required to return table name and catalog name information is only performed if the ResultSetMetaData.getTableName() or ResultSetMetaData.getCatalogName() methods are called.