• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 41860
908
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: 41860
908
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.
 
Then YOU must do the pig's work! Read this tiny ad. READ IT!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic