You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Ray Kiddy <ki...@apple.com> on 2006/06/29 19:35:26 UTC

Using Derby within the JDK

I just saw the e-mail asking for a doc on how one uses Derby in a  
J2EE environment.

So, Derby is going to be or is part of the JDK. How does one use it  
in that environment? In all the flavors of that environment?

The instructions I see are a bit odd. I got the network server  
working and then, the next day, could not remember the incantations  
from the night before.

Does anyone still use korn shell? I know guys who used to work on  
mainframes who use it, but nobody else.

If Derby is in the JDK, there is going to be a whole new class of  
users. Those who remember AOL hooking up to the Internet remember how  
fun that can be.

So, is anyone thinking of a more accessible set of docs on the  
initial setup? I am willing to write something, but I probably have a  
different approach to these things.

If anyone has any suggestions, please speak up. Criticisms are ok,  
too, but I do know databases and have set up and maintained several  
different kinds and I just think using a db that is in the JDK should  
be a lot more obvious.

thanx - ray


Re: Using Derby within the JDK

Posted by Andrew McIntyre <mc...@gmail.com>.
On 6/29/06, Ray Kiddy <ki...@apple.com> wrote:
>
> Does anyone still use korn shell? I know guys who used to work on
> mainframes who use it, but nobody else.

Well, ksh is my preferred shell, but bash and ksh are so similar that
I don't bother switching if I end up in one or the other.

Take a look at DERBY-1032. I just uploaded a set of new scripts there
that hopefully will go into the /bin directory of the distributions
for 10.2. Just untar the file into where you put the rest of the -bin
(or -lib) distribution. Setup will go something like:

"Set the DERBY_HOME environment variable to the location where you
have installed Derby. Set JAVA_HOME to the home directory of a JDK or
JRE installation. Then, add the /bin directory to your path like so:

export PATH=$DERBY_HOME/bin:$PATH

You should now be able to run the Derby tools. Confirm that the
environment variables are set properly by running sysinfo:

$ sysinfo
...
<show sysinfo output>
...

You can now use ij, the interactive JDBC scripting tool, to create a
database and begin running SQL commands:

$ ij
ij Version 10.2
> connect 'jdbc:derby:myDB;create=true';
> create table t1 ( c1 int, c2 int );
etc.
"

Also, 10.2 will have an executable jar file, derbyrun.jar, that
provides easy access to the tools from the command line and are in the
directory where you have installed Derby. e.g.:

java -jar lib/derbyrun.jar ij

will run ij.

> So, is anyone thinking of a more accessible set of docs on the
> initial setup? I am willing to write something, but I probably have a
> different approach to these things.

The Working With Derby document aims to be a quick up-and-running
guide for new users. It is also new with 10.2. See:

http://db.apache.org/derby/docs/dev/workingwithderby/

cheers,
andrew

Re: Using Derby within the JDK

Posted by "Jean T. Anderson" <jt...@bristowhill.com>.
Ray Kiddy wrote:
> 
> I just saw the e-mail asking for a doc on how one uses Derby in a  J2EE
> environment.
> 
> So, Derby is going to be or is part of the JDK. How does one use it  in
> that environment? In all the flavors of that environment? 

Some resources on how to use Derby are listed in these places:

   http://wiki.apache.org/db-derby/
   http://wiki.apache.org/db-derby/WorkingWithDerby
   http://db.apache.org/derby/integrate/index.html

Contributions are always welcome! And anyone can add pointers to more
resources on the http://wiki.apache.org/db-derby/WorkingWithDerby page.

 -jean

p.s. I use the Korn shell, which is why the tutorial at
http://db.apache.org/derby/papers/DerbyTut includes Korn shell syntax.