带ms访问的JDBC? [英] JDBC with ms-access?
问题描述
如何使用JDBC代码在Windows中连接到基于Microsoft Access的数据库?
How to connect to a Microsoft Access-based database in a Windows using JDBC code?
为Type-1和Type-4类型编写什么语法驱动程序?
What syntax is to be written for Type-1 and Type-4 types of the drivers?
Class.forName(" ");
我们使用的驱动程序的每种类型的上述语法是否不同?我们如何定义和识别我们使用的驱动程序的类型?
Is the above syntax different for everytype of the driver we use? How can we define and identify the type of the driver we use??
如果可能的话,还要为oracle指定要加载的驱动程序语法..
If possible then also specify for the oracle also the driver syntax to be loaded..
推荐答案
您可以通过调用来使用JDBC-ODBC桥:
You can use JDBC-ODBC bridge by calling:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
然后您可以在表单中使用JDBC数据库URL:
Then you can use JDBC database URL in form:
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\Nwind.mdb
或者如果在ODBC管理器中配置数据库可以使用其别名:
or if you configure your database in ODBC manager you can use its alias:
jdbc:odbc:northwind
这篇关于带ms访问的JDBC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!