Hello,
it's a bug which will be fixed in the next version. Until a new driver will
be available you can apply the following fix in
com.sap.dbtech.jdbc.DatabaseMetaDataSapDB.java

Replace the method: 
        public ResultSet getTableTypes() throws SQLException 
with following implementation:
    public ResultSet getTableTypes() throws SQLException {
        ResultSet result;
        String [] colHeadings = {"TABLE_TYPE"};
        Object [][] rows = {
            {"RESULT"},
            {"SYNONYM"},
            {"SYSTEM"},
            {"TABLE"},
            {"VIEW"},
            };

        result = new MemoryResultSetSapDB (colHeadings, rows);
        return result;
    }

Thank you for reporting the bug,
Marco

> -----Original Message-----
> From: Zoltan Debreczy [mailto:[EMAIL PROTECTED]]
> Sent: Mittwoch, 12. Juni 2002 11:55
> To: [EMAIL PROTECTED]
> Subject: JDBC: DatabaseMetaData.getTableTypes() does not return
> "SYNONYM" as table type
> 
> 
> Is it a bug or a feature?
> If it is a bug, can you tell me how long?
> If it is a feature, can you tell me why?
> 
> Thanks in advance!
> 
> Zoltan Debreczy
> mailto:[EMAIL PROTECTED]
> 
> My tests:
> 
> 0. Environment:
> OS:
>   Microsoft Windows NT 4.00.1381
> application.getServerInfo():
>   Apache Tomcat/4.0.3
> 
> DatabaseMetaData.getDatabaseProductVersion():
>   Kernel 7.3.0 Build 024-000-000-000
> DatabaseMetaData.getDriverVersion():
>   package com.sap.dbtech.jdbc, "SAP DB JDBC Driver", "SAP 
> AG", "7.3.0 Build
> 023-000-085-131"
> 
> 1. Table types returned by 'DatabaseMetaData.getTableTypes()' are:
>    RESULT
>    SNAPSHOT
>    SYSTEM
>    SYSTEM TABLE
>    TABLE
>    UNLOADED
>    VIEW
> 
> Sample code:
> ...
> Connection       oConnection       = 
> DriverManager.getConnection (oStDbUrl,
> oStUserName, oStPassword);
> DatabaseMetaData oDatabaseMetaData = oConnection.getMetaData();
> ResultSet        oRsTableTypes     = 
> oDatabaseMetaData.getTableTypes();
> 
> while ( oRsTableTypes.next() ) {
>   out.println( oRsTableTypes.getString(1) + "<BR>" );
> }
> oRsTableTypes.close();
> oConnection.close();
> ...
> 
> 2. 'DatabaseMetaData.getTables(catalog, schema, tablePattern, 
> tabletypes[])'
> without table type definition
>     returns as table type "SYNONYM"s:
>     (I have a newly created database, the schema "SYS" has a lot of
> SYNONYMs.)
> 
> Sample code:
> ...
> Connection       oConnection       = 
> DriverManager.getConnection (oStDbUrl,
> oStUserName, oStPassword);
> DatabaseMetaData oDatabaseMetaData = oConnection.getMetaData();
> 
> ResultSet        oRsTables         = oDatabaseMetaData.getTables(null,
> "SYS", null, null);
> 
> while ( oRsTables.next() ) {
>   out.println(   "TABLE_TYPE:" + oRsTables.getString(4)
>              + ", TABLE_NAME:" + oRsTables.getString(3) + "<BR>" );
> }
> oRsTables.close();
> oConnection.close();
> ...
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to