java 连接 db2,Db2连接问题与java

I am having problem with DB2. I just installed the db2 as a db2admin and with a password. When i try to connect to database it is success full and while running any simple select query it give me following error:-

DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82

I have a database named onp and a table in it called 'login' in which there is one table called 'login' with two fields username and password.

Query that i am running

Select * from login; gives me error

DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82

Select * from system.login; gives me error:- (//system is schema name)

DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=DB2ADMIN;SELECT;SYSTEM.LOGIN, DRIVER=3.57.82

I have tried all the resources on the net and exhausted completely. Please help me

解决方案

I don't know a lot about DB2, but looking up the error codes...

The first error is because you didn't specify a schema, so it couldn't find the login table.

SQLCODE -204 Object not defined to DB2

DB2 apparently requires you to specify the schema name or it looks in the schema with the same name as your login user.

You must use SET SCHEMA or fully qualify the table name.

The second error is because you don't have the privileges to perform that select:

SQLCODE -551, Error: DOES NOT HAVE

THE PRIVILEGE TO PERFORM OPERATION ON

OBJECT

I'm not sure why the db2admin user wouldn't be able to select from this table...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值