aspose file tools*
The moose likes JDBC and the fly likes unable to connect to cloudscape Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "unable to connect to cloudscape" Watch "unable to connect to cloudscape" New topic
Author

unable to connect to cloudscape

jonathan Greens
Ranch Hand

Joined: Apr 07, 2004
Posts: 139
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
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

Jonathan,
I think the prefix for cloudscape is db2j. Try:


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
jonathan Greens
Ranch Hand

Joined: Apr 07, 2004
Posts: 139
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

Joined: Apr 07, 2004
Posts: 139
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

Jonathan,
Thanks for sharing the solution (with the comma) and glad to hear it is working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unable to connect to cloudscape