Hi,
The class below works with 1.1.017 on April 07, 2006 eval version but does not work with 1.1.032 on May 08, 2006, the full version.
By "works" I mean it prints out the names of all the tables in that database (better said, the result set returned by getTable contains rows)
Any help would be great.
Thx,
Andrei
import java.sql.*;
/**
* ShahAmit (@auther : shahamit@synygy.com)
*/
public class TestClass {
public static void main(String[] args) {
String connectionURL = "jdbc:access:/" +
"\\\\ind-fil1\\Departments\\SoftwareDevelopment\\AmitShah\\LPTestingFiles\\Access\\acc1.mdb?user=;password=";
try {
Class.forName("com.hxtt.sql.access.AccessDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
try {
Connection connection = DriverManager.getConnection(connectionURL);
if (connection != null) {
DatabaseMetaData databaseMetaData = connection.getMetaData();
if (databaseMetaData != null) {
ResultSet resultSet = databaseMetaData.getTables(null, null, null, null);
// ResultSet resultSet = connection.createStatement().executeQuery(
// "SELECT * FROM MsysObjects WHERE (Left([Name],1)<>'~') AND (lcase(Left([Name],4)) <> 'msys') AND (MSysObjects.Type)=1 order by MSysObjects.Name");
while (resultSet.next()) {
System.out.println("Table Name : " + resultSet.getString(3));
}
} else {
System.out.println("Meta Data is null");
}
} else {
System.out.println("Connection is null");
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
|
Fixed a new bug in DatabaseMetaData.getTables() since v1.1.028. When we complemented support for simple stored procedures (select, insert, update, and delete), we added such a bug too:( Thanks for your response. Please download the latest package.
|
Thx for the quick response. It's working now.
Andrei
|