1

Hi I'm new in Bluemix and I just tried some of sample code of SQLDB in Bluemix.

I tried example from this site.

I follow the step from readme.md file. But after I deployed my application, error happens.

Executing: CREATE SCHEMA SQLDBSAMPLE
Error creating schema: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=USER12999;CREATE SCHEMA, DRIVER=3.66.46
Executing: CREATE TABLE SQLDBSAMPLE.PAYROLL1451703603548 (NAME VARCHAR(20), AGE INTEGER)
Error creating table: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=USER12999;IMPLICIT CREATE SCHEMA, DRIVER=3.66.46
Executing: INSERT INTO SQLDBSAMPLE.PAYROLL1451703603548 VALUES ('John Smith', 52)
Error executing:INSERT INTO SQLDBSAMPLE.PAYROLL1451703603548 VALUES ('John Smith', 52)
SQL Exception: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SQLDBSAMPLE.PAYROLL1451703603548, DRIVER=3.66.46
Executing: DROP TABLE SQLDBSAMPLE.PAYROLL1451703603548
Error dropping table: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SQLDBSAMPLE.PAYROLL1451703603548, DRIVER=3.66.46
Executing: DROP SCHEMA SQLDBSAMPLE RESTRICT
Error Dropping schema: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SQLDBSAMPLE, DRIVER=3.66.46
Finished
2
  • Please help guys I already browse for 3 days only for run simple query in my Java web apps in Bluemix. And still stuck now :( Commented Jan 2, 2016 at 4:11
  • "DB2 SQL Error: SQLCODE=-552", through just Googling, indicates you have insufficient permissions. Are you sure you've bound the service to your application and are reading and using the credentials correctly? Commented Jan 2, 2016 at 8:11

1 Answer 1

1

The first error you are getting depends on the fact that the user (USER12999) has not the privileges to create a schema. The second one is related to the same issue, since it is trying to create implicitly the schema. All the next errors are telling you that the table doesn't exist. I guess you're using the free BETA SQL DB Plan. It provides you the default schema (with the same name of your username): you could create the table in that default schema, just commenting out the CREATE SCHEMA line and removing explicit schema SQLDBSAMPLE from other statements in the sample code you posted.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.