java 知识点总结 --java解析.mdb文件的表名
作者:互联网
//java解析.mdb文件的表名集合
this.tableList.clear();
conn = null;
st = null;
rs = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url ="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+dbName;//此为NO-DSN方式
//System.out.println("mdb文件路径:"+dbName);
conn=DriverManager.getConnection(url);
conn.setCatalog(dbName);
ResultSet tables = conn.getMetaData()
.getTables(dbName,null,null,new String[]{"TABLE"});
while(tables.next()){
String str = tables.getString(3);//getXXX can only be used once here
tableList.add(str);
}
//关闭连接
.............
标签:知识点,java,String,--,mdb,null,dbName,conn 来源: https://blog.51cto.com/u_3075318/2707034