当前位置: 代码迷 >> Java相关 >> MS Access JDBC驱动(共享)
  详细解决方案

MS Access JDBC驱动(共享)

热度:553   发布时间:2008-02-29 17:29:09.0
MS Access JDBC驱动(共享)
本人找到了真正的可以用的MS Access JDBC驱动程序
再此共享一下
Test java code
--------------------------------
public DataBase(String TableName){
        
         try{
            
             Class.forName("com.hxtt.sql.access.AccessDriver");
             con = DriverManager.getConnection("jdbc:access:/./db/Test.mdb");
             //System.out.println("OK");
             state=con.createStatement();
             rs=state.executeQuery("select * from "+TableName+" order by User_ID");
             rsmd = rs.getMetaData();
            
             Datas = new Vector<String>();
                while(rs.next()){     
                   for(int i =1;i<=rsmd.getColumnCount();i++)
                       Datas.add(rs.getString(i).trim());
                }
                
             Titles = new Vector<String>();
             for(int i =1;i<=rsmd.getColumnCount();i++)
                   Titles.add(rsmd.getColumnName(i).trim());
            // System.out.println(Datas+"\n"+Titles);
         }catch(Exception e){
             e.printStackTrace();
         }

     }
--------------------------------------------
具体用法可以看里面的html帮助文挡

.......................................
无语了
太大传不上去
搜索更多相关的解决方案: JDBC  Access  驱动  

----------------解决方案--------------------------------------------------------
  相关解决方案