JDBC connection.getschema() AbstractMethodError

Connectivity
Enthusiast

JDBC connection.getschema() AbstractMethodError

I am trying get the default database name from the connection for Teradata. I am using Teradata JDBC 15.10.00.33.

The following code gives me this abstract method error. Can anyone suggest me how I can get default database name using jdbc?

 

public class TestTDConnection {

    public static void main(String args[]) {

        String tdConnString = "jdbc:teradata://xx/database=xx";

        try {
            Connection conn = DriverManager.getConnection(tdConnString,"xx","xx");
            System.out.println(conn.getSchema());
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
Exception in thread "main" java.lang.AbstractMethodError: com.teradata.jdbc.jdk6.JDK6_SQL_Connection.getSchema()Ljava/lang/String;

1 REPLY
Teradata Employee

Re: JDBC connection.getschema() AbstractMethodError

Connection.getSchema is a JDK 7 feature, and is not yet supported by the Teradata JDBC Driver.

 

Please refer to my blog entry on this topic, which was written before Connection.getSchema was introduced with JDK 7.

https://community.teradata.com/t5/Blog/How-to-determine-or-switch-the-current-database-using-the/ba-...