HSQLDB测试连接时显示如下错误,求解决,不能插入数据。28行是执行插入数据的语句
java.sql.SQLSyntaxErrorException:userlacksprivilegeorobjectnotfound:PETSatorg.hsqldb....
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: PETS
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at testJDBC.Test.main(Test.java:28) 展开
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
at testJDBC.Test.main(Test.java:28) 展开
2个回答
展开全部
// 创建用户 surveymap(任意数据库合法名字都行)
// 登录是账号密码都为大写
CREATE USER surveymap PASSWORD password;
GRANT DBA TO surveymap;
// ON T_ELEVATION ==》 ON后面为表名
GRANT SELECT, UPDATE,DELETE ON T_ELEVATION TO surveymap;
GRANT SELECT, UPDATE,DELETE ON T_ELEVATION_LINE TO surveymap;
GRANT SELECT, UPDATE,DELETE ON T_PLANE TO surveymap;
GRANT SELECT, UPDATE,DELETE ON T_PLANE_LINE TO surveymap;
// 登录是账号密码都为大写
CREATE USER surveymap PASSWORD password;
GRANT DBA TO surveymap;
// ON T_ELEVATION ==》 ON后面为表名
GRANT SELECT, UPDATE,DELETE ON T_ELEVATION TO surveymap;
GRANT SELECT, UPDATE,DELETE ON T_ELEVATION_LINE TO surveymap;
GRANT SELECT, UPDATE,DELETE ON T_PLANE TO surveymap;
GRANT SELECT, UPDATE,DELETE ON T_PLANE_LINE TO surveymap;
2013-03-07
展开全部
怎样的语句、怎样的表结构
追问
表:create table pets (id int,name varchar(10),type_id int,owner_id int);
28行:state.executeUpdate("insert into pets values(1,'aa',1,2)");
追答
HSQLDB 退出程序,可以看完整的HSQLDB定义文件
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询