Java中报错undefined,“未定义符号:SQLAllocEnv”; Java中的错误

I am using java to build an application which requires to use MS Access.

I am geting the following error when I run the project:

/usr/lib/jvm/jdk1.7.0/bin/java: symbol lookup error: /usr/lib/jvm/jdk1.7.0/jre/lib/i386/libJdbcOdbc.so: undefined symbol: SQLAllocEnv

What does it mean?

解决方案

As you mention in your previous question you are trying to do development in Linux (Ubuntu) for a project that will ultimately be deployed on Windows. I suspect that you are trying to use the JDBC-ODBC Bridge in Linux without having the appropriate driver software installed.

I have seen many answers that talk about using unixODBC and MDB Tools to manipulate an Access database under Linux, but in my own experience that hasn't worked out very well. Instead I would offer the following advice:

If you are developing a project for Windows then do your development under Windows. Then you can use the JDBC-ODBC Bridge and an actual Microsoft Access ODBC driver. However, bear in mind that the JDBC-ODBC Bridge has been removed from JDK8 and is not supported, as mentioned in the previous answer here.

If you must do your development under Linux then use UCanAccess (or perhaps just Jackcess, which UCanAccess uses as its lower-level interface to Access database files) and deploy the required components with your application.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值