JavaEE
(1)
收藏
我要回答
package com.wanmait.util; import net.ucanaccess.converters.Metadata; import java.sql.*; public class Test { @org.junit.Test public void test(){ try { Class.forName("net.ucanaccess.jdbc.UcanaccessDriver"); String accessDb = "D:/wanmait.com/demo.mdb"; String dbURL = "jdbc:ucanaccess://"+accessDb; Connection conn = DriverManager.getConnection(dbURL); System.out.println(conn); DatabaseMetaData metadata = conn.getMetaData(); ResultSet tables = metadata.getTables(null,null,"%",null); while(tables.next()){ System.out.println(tables.getString(3)); } tables.close(); conn.close(); } catch (Exception e){ e.printStackTrace(); } } }
1个回答
我要回答