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
Kim
  • 1,081
  • 2
  • 12
  • 17
  • 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 :( – Kim Jan 02 '16 at 04: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? – nitind Jan 02 '16 at 08:11

1 Answers1

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.

mustaccio
  • 18,234
  • 16
  • 48
  • 57
Umberto Manganiello
  • 3,213
  • 9
  • 16