freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Paul Hopkins" <phopkins AT hi-q.co.uk>
- To: freetds AT franklin.oit.unc.edu
- Subject: Extracting METADATA from JDBC connection
- Date: Tue, 17 Jul 2001 08:34:37 -0400
Hello,
I am evaluating freeTDS and am tring to check whether it supports db
metadata. I am using the following code but getting the SQLException with the
message 'Confused'. Any help is appreciated.
Thanks, Paul
Class.forName("com.internetcds.jdbc.tds.Driver");
String url =
"jdbc:freetds:sqlserver://"+serverName+":1433/"+database;//+";TDS=7.0";
// Create the usename and password properties
try
{
// Create the connection
Connection c = DriverManager.getConnection( url, username,
password );
// Run a simple query
Statement s = c.createStatement();
ResultSet rs = s.executeQuery("select * from phSourcePerson");
while (rs.next())
{
System.out.println(rs.getString(1) + " : " + rs.getInt(2));
}
rs.close();
s.close();
System.out.println("Retrieving a list of all tables");
DatabaseMetaData md = c.getMetaData();
// THIS IS THE CALL THAT FAILS
rs = md.getTables( null, null, "phSourcePerson", new
String[]{"TABLE"});
System.out.println("After");
while (rs.next())
{
System.out.println(rs.getString(1));
}
rs.close();
c.close();
- Extracting METADATA from JDBC connection, Paul Hopkins, 07/17/2001
Archive powered by MHonArc 2.6.24.