小编Raj*_*ora的帖子

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:sun.reflect中"字段列表"中的未知列'raj'

我正在制作一本简单的电话簿日记,所以这是我的数据库架构:

create database if not exists Rajendra;

use Rajendra;

create table if not exists family(name varchar(50), mobile varchar(50));

select * from family;
Run Code Online (Sandbox Code Playgroud)

现在,我正在插入值,input dialog boxes但这给了我这样的错误:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'raj' in 'field list'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819)
    at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1811)
    at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1725)
    at phonebook.MainProgram$2.actionPerformed(MainProgram.java:76)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source) …
Run Code Online (Sandbox Code Playgroud)

java mysql jdbc

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

java ×1

jdbc ×1

mysql ×1