問題描述
我在使用 DB2 時遇到問題.我剛剛將 db2 安裝為 db2admin 并使用密碼.當我嘗試連接到數據庫時,它完全成功,并且在運行任何簡單的選擇查詢時,它給了我以下錯誤:-
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 錯誤:SQLCODE=-204、SQLSTATE=42704、SQLERRMC=DB2ADMIN.LOGIN、DRIVER=3.57.82
DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82
我有一個名為 onp 的數據庫和一個名為login"的表,其中有一個名為login"的表,其中包含兩個字段用戶名和密碼.
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.
查詢我正在運行
- 從登錄中選擇 *;給我錯誤
DB2 SQL 錯誤:SQLCODE=-204,SQLSTATE=42704,SQLERRMC=DB2ADMIN.LOGIN,DRIVER=3.57.82
DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.LOGIN, DRIVER=3.57.82
- 從 system.login 中選擇 *;給我錯誤:-(//系統是架構名稱)
DB2 SQL 錯誤:SQLCODE=-551, SQLSTATE=42501, SQLERRMC=DB2ADMIN;SELECT;SYSTEM.LOGIN, DRIVER=3.57.82
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
推薦答案
我對DB2了解不多,但是查找錯誤代碼...
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 對象未定義到 DB2
SQLCODE -204 Object not defined to DB2
DB2 顯然要求您指定模式名稱,否則它會在模式中查找與您的登錄用戶同名的名稱.
DB2 apparently requires you to specify the schema name or it looks in the schema with the same name as your login user.
您必須使用 SET SCHEMA
或完全限定表名.
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,錯誤:沒有執行操作的特權對象
SQLCODE -551, Error: DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION ON OBJECT
我不確定為什么 db2admin 用戶無法從該表中進行選擇...
I'm not sure why the db2admin user wouldn't be able to select from this table...
資源:
DB2 SQLCODE 列表
這篇關于java的db2連接問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!