Db2 Sql Error 42704
Contents |
new Controller DB Technote (troubleshooting) Problem(Abstract) Administrator is attempting to connect to (or sqlcode=-204 sqlstate=42704 create a new) Controller database, which is based on DB2.
Sqlcode=-204 Sqlstate=42704 Sqlerrmc=
Administrator launches Controller Configuration, and launches the 'Database Conversion Utility'. User clicks 'Create DB'. An
Is An Undefined Name.. Sqlcode=-204 Sqlstate=42704
error appears. throws an error that includes "DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=
Sqlcode=-104 Sqlstate=42601
Running DB Step: initial Running script batch: script/db2_createDB.batch Running script: script/db2/sequence_xdbtrickle_seq.sql Running script: script/db2/table_xdb00.sql ** ERROR: com.ibm.db2.jcc.am.io: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=DECLARE sSql VARCHAR2(4000); BEGIN ;BEGIN-OF-STATEMENT;
using DbConv to create new database Technote (troubleshooting) Problem(Abstract) Administrator creates brand new sqlcode=-727 (blank) DB2 database. Administrator logs onto the Controller application server, db2 sql error sqlcode 204 sqlstate 42704 sqlerrmc launches 'Controller Configuration' and creates a new database connection to the database. Administrator clicks 'connect' sqlcode 204 sqlstate 42704 ibm-db2 and then clicks 'Create DB'. An error appears. Symptom Depending on the environment the error may appear slightly differently, but it will be similar to: http://www-01.ibm.com/support/docview.wss?uid=swg21613531 ** ERROR: com.ibm.db2.jcc.am.io: DB2 SQL Error: SQLCODE=-204, SQLSTATE=-42704, SQLERRMC=CONTRO, DRIVER=3.57.82 ** ERROR: Invalid datbase, XFRANGO is empty Cause There are many potential causes for similar-looking DB2 errors. NOTE: This Technote *only* relates to the scenario where the error contains the codes: SQLCODE=-204, SQLSTATE=-42704 In this scenario, there are several possible http://www.ibm.com/support/docview.wss?uid=swg21681892 causes for the errors: Scenario #1 - DB2 database server is not using 'Oracle Compatibility Mode'. TIP: In this scenario, the error message will typically contain the word 'USER_TABLES' Scenario #2 - DB2 database client (installed on the Controller application server) has "Enable operating system security for DB2 objects" enabled. Scenario #3 - DB2 database has not been created correctly. Diagnosing the problem IMPORTANT: It is vital that you check the exact 'SQLCODE' and 'SQLSTATE' error numbers, to help you troubleshoot the root cause. Make sure that you check the error code reference numbers precisely. If they are different, then search IBM Technotes for different/specific advice for your error code. Resolving the problem Scenario #1 Delete the database. Re-configure the DB2 database server to use 'Oracle Compatibility Mode'. Re-create the DB2 database. Re-try. For more information, see separate IBM Technote #1613531. Scenario #2 There are two different me
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/20919298/db2-sql-error-sqlcode-204-sqlstate-42704 of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: 204 sqlstate Sign up DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704 up vote 4 down vote favorite 1 I created local database in DB2 called "TestDB" then I created table called "TestTable". I found that the table is put under schema name is "yasmin". I am trying to connect to the DB2 database using JDBC but I got this exception R SQLException information [1/4/14 11:32:59:289 EST] db2 sql error 0000004d SystemErr R Error msg: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.TESTTABLE, DRIVER=3.61.86 [1/4/14 11:32:59:290 EST] 0000004d SystemErr R SQLSTATE: 42704 [1/4/14 11:32:59:290 EST] 0000004d SystemErr R Error code: -204 [1/4/14 11:32:59:290 EST] 0000004d SystemErr R com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.TESTTABLE, DRIVER=3.61.86 I tried many solutions on the internet Like set schema but unfortunately doesn't work. This is the JDBC code I used String urlPrefix = "jdbc:db2:"; String url; String user; String password; String empNo; Connection con; Statement stmt; ResultSet rs; url = urlPrefix + "//127.0.0.1:50000/TestDB"; user = "db2admin"; password = "db2admin"; try { // Load the driver Class.forName("com.ibm.db2.jcc.DB2Driver"); System.out.println("**** Loaded the JDBC driver"); // Create the connection using the IBM Data Server Driver for JDBC and SQLJ con = DriverManager.getConnection (url, user, password); // Commit changes manually con.setAutoCommit(false); System.out.println("**** Created a JDBC connection to the data source"); stmt = con.createStatement(); con.createStatement(); System.out.println("**** Created JDBC Statement object"); // Execute a query and generate a ResultSet instance rs = stmt.executeQuery("select *from TestTable"); System.out.println("**** Created JDBC ResultSet object"); } catch (ClassNotFoundException e) { System.err.println("Could not load JDBC driver"); System.out.println("Exception: " + e); e.printStackTrace(); } catch(SQLExcept