Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

unable to connect to cloudscape

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used Class.forName("com.ibm.db2j.jdbc.DB2jDriver"); to load the driver, it executed correctly.
Then When I try to connect to "jdbc:cloudscape:xxx;create=true";
or just "jdbc:cloudscape:xxx"
I get
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:211)
what's wrong?
thanks
 
author & internet detective
Posts: 41086
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jonathan,
I think the prefix for cloudscape is db2j. Try:
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeane,
thanks! that helps.
I have run into another problem when I try to execute the query against cloudscape. This query works fine in other databases like access but fails here. what's wrong? It seems like the ',' is causing some trouble.

CREATE TABLE Users(lastName varchar,firstName varchar,userName varchar,password varchar,email varchar,gender varchar,adminPriv varchar,securityQuestion varchar,securityAnswer varchar,bDayYear varchar,bDayMonth varchar,bDayDate varchar,title varchar,organization varchar,address1 varchar,address2 varchar,city varchar,state varchar,zip varchar,email2 varchar,enabled varchar)
ERROR 42X01: Syntax error: Encountered "," at line 1, column 41.
at db2j.dl.b.newException(Unknown Source)
at db2j.aa.e.parseStatement(Unknown Source)
at db2j.br.c._ly(Unknown Source)
at db2j.br.c.prepare(Unknown Source)
at db2j.bq.f.prepareInternalStatement(Unknown Source)
at db2j.ai.p.<init>(Unknown Source)
at db2j.ax.e.<init>(Unknown Source)
at db2j.aw.b.<init>(Unknown Source)
at com.ibm.db2j.jdbc.EmbeddedDriver30.newLocalPreparedStatement(Unknown Source)
at db2j.ai.c._xs(Unknown Source)
at db2j.ai.c.prepareStatement(Unknown Source)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:185)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:278)
at com.titan.software.atbm.db.ConnectionManager.execUpdate(ConnectionManager.java:202)
at com.titan.software.atbm.db.ConnectionManager.createSchema(ConnectionManager.java:140)
at com.titan.software.atbm.db.ConnectionManager.main(ConnectionManager.java:54)
 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found the problem, it seems like I need to specify the length n for varchar, i don't have to do this for ms access.
 
Jeanne Boyarsky
author & internet detective
Posts: 41086
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jonathan,
Thanks for sharing the solution (with the comma) and glad to hear it is working.
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic