Loading ...
Sorry, an error occurred while loading the content.
 

Re: Request : Add hsqldb jdbc link

Expand Messages
  • judoscript
    ... Speaking of HSQLDB, I do recommend to have its jar in your classpath! At least, you can use its simple but good enough AWT-based JDBC management tool,
    Message 1 of 5 , Nov 3, 2003
      > And yes, this stuff _really_ impresses me as well, it's the next
      > best free thing I found next to JudoScript.
      >

      Speaking of HSQLDB, I do recommend to have its jar in your classpath!
      At least, you can use its simple but good enough AWT-based JDBC
      management tool, which visually displays the schema and allows you to
      run SQL. Its class name is org.hsqldb.util.DatabaseManager.

      Here is a brief description of how I used it. It is very simple.

      1. Certainly, have hsqldb.jar in your classpath.
      2. Create a directory anywhere, such as d:\mydata\, and create a
      batch file such as startdb.bat like this:

      ---------------------------------------------
      d:
      cd \mydata\
      java org.hsqldb.Server -database mydb
      ---------------------------------------------

      You don't have to do anything to create the database. The first time
      it runs and does not see a database, it creates one for you (with
      user name as "sa" and no password).

      3. Connect to it via JDBC (through JudoScript, of course :) ):

      ---------------------------------------------
      connect to 'jdbc:hsqldb:hsql://localhost', 'sa', '';

      executeSQL
      {
      CREATE TABLE my_table (
      id INTEGER PRIMARY KEY,
      name VARCHAR NOT NULL,
      password VARCHAR,
      email VARCHAR NOT NULL,
      country_id INTEGER,
      active BIT,
      create_time DATE NOT NULL,
      UNIQUE (email),
      FOREIGN KEY (country_id) REFERENCES country(id)
      );

      ....
      }

      disconnect();
      ---------------------------------------------

      And from now on, business as usual for your black-belters.


      4. What is interesting is, in the data directory, 2 files seem to be
      important: mydb.data and mydb.script. But mydb.data seems always of 0
      bytes, where mydb.script keeps all the SQL statements! Kinda like
      Oracle REDO log, which allows you to reproduce the whole database.
      Near the top, it has a line:

      CREATE USER SA PASSWORD "" ADMIN

      -- I changed the admin user/password by editing this file! Don't
      forget to also change the following statement, otherwise it won't
      work:

      CONNECT USER sa PASSWORD ""



      So far I am happy with its SQL support and data types especially its
      close mapping to Java types. Not sure how well it will behave under a
      lot of load, but is sure a fun thing to play with.

      -James
    • kenderband
      ... classpath! Eh, rather embarrasing I cant seem to modify the classpath on Debian easily. Also running the java -cp /usr/hsqldb/lib/hsqldb.jar -jar
      Message 2 of 5 , Nov 4, 2003
        --- In judoscript@yahoogroups.com, "judoscript" <judoscript@y...>
        wrote:
        >
        > > And yes, this stuff _really_ impresses me as well, it's the next
        > > best free thing I found next to JudoScript.
        > >
        >
        > Speaking of HSQLDB, I do recommend to have its jar in your
        classpath!

        Eh, rather embarrasing I cant seem to modify the classpath on Debian
        easily.
        Also running the
        java -cp /usr/hsqldb/lib/hsqldb.jar -jar /usr/judo/judo.jar -q $1 $2
        $3

        Doesnt put the hsqldb jar in my classpath, so I did merge the two
        jars since I didnt want to waste time.

        > At least, you can use its simple but good enough AWT-based JDBC
        > management tool, which visually displays the schema and allows you
        to
        > run SQL. Its class name is org.hsqldb.util.DatabaseManager.

        I use squirrel sql client, it's also in java and provides a really
        good look into the system tables.

        >
        > Here is a brief description of how I used it. It is very simple.
        >
        <BIG SNIP>
        I'm not planning to use it under windows, so I used the sripts from
        the bin folder which worked from the first time on.

        >
        >
        > 4. What is interesting is, in the data directory, 2 files seem to
        be
        > important: mydb.data and mydb.script. But mydb.data seems always
        of 0
        > bytes, where mydb.script keeps all the SQL statements! Kinda like
        > Oracle REDO log, which allows you to reproduce the whole database.
        > Near the top, it has a line:

        The help says that if you create tables like create cached table
        my_invoices .... That the keyword cached puts the table into the
        mydb.data file.

        > CREATE USER SA PASSWORD "" ADMIN
        >
        > -- I changed the admin user/password by editing this file! Don't
        > forget to also change the following statement, otherwise it won't
        > work:
        >
        > CONNECT USER sa PASSWORD ""
        >
        >
        >
        > So far I am happy with its SQL support and data types especially
        its
        > close mapping to Java types. Not sure how well it will behave
        under a
        > lot of load, but is sure a fun thing to play with.

        Yes it is. The mailing group says that after 2 Gigs it starts to
        behave bad.

        >
        > -James
      Your message has been successfully submitted and would be delivered to recipients shortly.