Skip to content

Commit f5ca063

Browse files
committed
Added derby and tomcat posts.
1 parent fb292f2 commit f5ca063

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

apache-derby-setup.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
title: Apache Derby setup and ij usage
2+
tags: derby,derby-setup
3+
4+
First download Apache Derby from its website. And put the both to the unzipped folder in your environment, including your PATH.
5+
6+
export DERBY_HOME = /your/path
7+
export PATH=$PATH:$DERBY_HOME/bin
8+
9+
You also need to set the derby property to say the database is on localhost for the 'ij' property:
10+
11+
set DERBY_OPTS=-Dij.protocol=jdbc:derby://localhost/
12+
13+
Now you should be able to run the 'ij' program. Exit it via issuing 'quit;'.
14+
15+
Open up ij, and create a new database:
16+
17+
ij> CONNECT 'jdbc:derby:firstdb;create=true';
18+
19+
In the current directory you'll have a firstdb/ directory. This constitutes the database. Don't touch the files within!
20+
21+
You can then create a new simple table, insert a value and print the table using the following usual SQL:
22+
23+
24+
ij> create table one (text varchar(500));
25+
0 rows inserted/updated/deleted
26+
ij> insert into one values ('hello');
27+
1 row inserted/updated/deleted
28+
ij> select * from one;
29+
TEXT
30+
--------------------------------------------------------------------------
31+
hello
32+
33+
Since ij doesn't have a command history, you may want to issue the commands from the command line instead:
34+
35+
$ echo "connect 'jdbc:derby:firstdb'; select * from one;" | ij
36+
ij version 10.10
37+
ij> ij> TEXT
38+
--------------------------------------------------------------------------
39+
hello
40+
41+
1 row selected

tomcat7-debug-eclipse.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
title: Tomcat 7: Debugging in Eclipse
2+
tags: tomcat,tomcat-debug
3+
4+
In your catalina.sh file (if you're using unix), you must place this at the top:
5+
6+
export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
7+
8+
Note the line may contain other options, but the above must be there nonetheless.
9+
10+
Now stop and start tomcat.
11+
12+
Then go into Debug Configurations in Eclipse and add a new Remove Java Application. Enter the following details:
13+
14+
host: localhost
15+
post: 8000
16+
17+
You can now start this debug configuration. Your application will stop and eclipse will move to a breakpoint added in eclipse should you hit on.

0 commit comments

Comments
 (0)