cloudscape

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob

    cloudscape

    I'm a newbie in cloudscape (Java too) and I'm having a problem. I've
    followed the tutorial that comes with cloudscape to the letter. Everything
    worked as advertised up untill this program:

    /*
    * Licensed Materials - Property of IBM
    *
    * (C) Copyright IBM Corp. 2000, 2001
    * All Rights Reserved.
    */
    import java.sql.*;

    public class CreateWorldDB {



    public static void main (String[] args) {

    try {

    Class.forName(" com.ibm.db2j.jd bc.DB2jDriver") .newInstance();
    System.out.prin tln("Loaded the Cloudscape JDBC
    driver. Hello, World!");
    Connection conn =

    DriverManager.g etConnection("j dbc:db2j:HelloW orldDB;create=t rue")

    ;
    System.out.prin tln("Created and connected to

    database HelloWorldDB");

    } catch (Throwable e) {
    System.out.prin tln("exception thrown");
    e.printStackTra ce();
    }

    }


    }

    I run it with "java -Dbd2j.system.ho me=C:\tutorial_ system CreateWorldDB"

    And results in:
    Loaded the Cloudscape JDBC driver. Hello, World!
    exception thrown
    java.sql.SQLExc eption: No suitable driver
    at java.sql.Driver Manager.getConn ection(Unknown Source)
    at java.sql.Driver Manager.getConn ection(Unknown Source)
    at CreateWorldDB.m ain(CreateWorld DB.java:18)

    What's going on? It can connect with that driver but it can't create/access?
    I'm highly confused...

    I'm running J2SE/HotSpot VM 1.4.2_03 and cloudscape5.1

    Thanks,
    Rob


  • Jared Dykstra

    #2
    Re: cloudscape

    "Rob" <talon2lm@yahoo .com> wrote in message news:<LISdnfS4B [email protected]> ...[color=blue]
    > I'm a newbie in cloudscape (Java too) and I'm having a problem. I've
    > followed the tutorial that comes with cloudscape to the letter. Everything
    > worked as advertised up untill this program:
    >
    > /*
    > * Licensed Materials - Property of IBM
    > *
    > * (C) Copyright IBM Corp. 2000, 2001
    > * All Rights Reserved.
    > */
    > import java.sql.*;
    >
    > public class CreateWorldDB {
    >
    >
    >
    > public static void main (String[] args) {
    >
    > try {
    >
    > Class.forName(" com.ibm.db2j.jd bc.DB2jDriver") .newInstance();
    > System.out.prin tln("Loaded the Cloudscape JDBC
    > driver. Hello, World!");
    > Connection conn =
    >
    > DriverManager.g etConnection("j dbc:db2j:HelloW orldDB;create=t rue")
    >
    > ;
    > System.out.prin tln("Created and connected to
    >
    > database HelloWorldDB");
    >
    > } catch (Throwable e) {
    > System.out.prin tln("exception thrown");
    > e.printStackTra ce();
    > }
    >
    > }
    >
    >
    > }
    >
    > I run it with "java -Dbd2j.system.ho me=C:\tutorial_ system CreateWorldDB"
    >
    > And results in:
    > Loaded the Cloudscape JDBC driver. Hello, World!
    > exception thrown
    > java.sql.SQLExc eption: No suitable driver
    > at java.sql.Driver Manager.getConn ection(Unknown Source)
    > at java.sql.Driver Manager.getConn ection(Unknown Source)
    > at CreateWorldDB.m ain(CreateWorld DB.java:18)
    >
    > What's going on? It can connect with that driver but it can't create/access?
    > I'm highly confused...
    >
    > I'm running J2SE/HotSpot VM 1.4.2_03 and cloudscape5.1
    >
    > Thanks,
    > Rob[/color]


    You define "bd2j.system.ho me" when running the code, but the package
    name is "db2j.system.ho me" If what you're defining is important, the
    program is not going to be able to find it. Use:

    java -Ddb2j.system.ho me=C:\tutorial_ system CreateWorldDB

    You might have other problems, but start with that.

    ---
    Jared Dykstra

    Comment

    Working...