使用java编程语言在访问文件中写入数据 [英] Writing data in access file using java programming language

查看:58
本文介绍了使用java编程语言在访问文件中写入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个系统,它将接收用户输入并将其作为注册系统数据库安全访问文件





最爱

我正在开发一个系统,它将接收用户输入并将其作为注册系统数据库安全访问文件



i'm developing a system that will take the user input and safe it in access file as database for registration system


favorite
i'm developing a system that will take the user input and safe it in access file as database for registration system

DBClass DB = new DBClass();
    DB.WrieToDatabase(jTextFieldID.getText(), jTextFieldname.getText(), jTextFieldemail.getText(), jPasswordFieldpass.getText(), jComboBoxgendar.getSelectedItem() +"" );





但是当我运行代码时给出以下错误消息:



java.sql.SQLException:没有为jdbc找到合适的驱动程序:odbc:Driver =(Microsoft Access Driver(* .accdb)}; DBQ = store.accdb; DriverID = 22; READONLY = false}错误:记录无法插入数据库



我尝试过的方法:



添加访问文件路径,但我不知道怎么做



but when i run the code it gives the following error message:

java.sql.SQLException: No suitable driver found for jdbc:odbc:Driver=(Microsoft Access Driver (*.accdb)};DBQ=store.accdb;DriverID=22;READONLY=false} Error: Record could not be inserted into the database

What I have tried:

adding the access file path but i am not sure how to do it

推荐答案

你可能正在使用最近的Java版本。这不再包括JDBC-ODBC桥,因此无法使用ODBC数据库驱动程序。



你必须使用相反,JDBC驱动程序。但问题是Micro不提供此类驱动程序软访问。因此,您必须使用商业或开源驱动程序(在Web上搜索jdbc访问驱动程序)。因为到目前为止我没有使用过,我不能推荐一个特定的。



或者使用不同的数据库。
You are probably using a recent Java version. That does not include the JDBC-ODBC bridge anymore so that ODBC database drivers can't be used.

You have to use a JDBC driver instead. But the problem is that such is not provided by Microsoft for Access. So you have to use a commercial or open source driver instead (search the web for "jdbc access driver"). Because I have not used one so far, I can not recommend a specific one.

Alternatively use a different database.


这篇关于使用java编程语言在访问文件中写入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆