20031208 Monday December 08, 2003

DB2 with Hibernate and Tomcat At my current project, we're using AppFuse for our baseline and (currently) Tomcat and MySQL for our databases. Soon we'll be migrating to DB2 for our database. I'm assuming everything will work smoothly with Hibernate, but there's probably some Ant things I will need to modify. For instance, with MySQL, I currently create a new database with the following script:

create database if not exists appfuse;
grant all privileges on appfuse.* to test@"%" identified by "test";
grant all privileges on appfuse.* to test@localhost identified by "test";

Is this possible with DB2? It's no biggie if it isn't - at my Comcast gig earlier in the year, we tied AppFuse/Hibernate into Oracle and simply didn't use the db-create nor db-init (creates tables) tasks. I use Hibernate's <schemaexport> task to create the tables - hopefully this will work in DB2. As for Tomcat, has anyone successfully configured DB2 with Tomcat's DBCP? We'll eventually be migrating to Websphere 5, hopefully it's not a big leap from Tomcat 4.1.27.

I haven't done any research on this yet, just wanted to put out some feelers and get any helpful advice before I start banging my head against the wall (hopefully I won't have to).

Posted in Java at Dec 08 2003, 10:01:55 AM MST 6 Comments

Comments:

Just wanted to make a reply on your Websphere question.

Websphere offers it's own DB pooling I believe, lookup through JNDI of course.

However, I believe that you can bypass it for the use of DBCP in your application. The trick, as always, is getting all the jars in the right CLASSPATH. :)

I've been following the Hibernate forums and it appears that it will work.

I'm interested in hearing about your experiences because my application also is starting with Tomcat + Hibernate + Spring + Postgresql but will probably need to be put into Websphere + DB2 + Hibernate + Spring.

BTW, I really like your site. I had no idea of blogging software written in Java. Roller looks really nice. Also the Wiki software that you recommend sounds interesting. I've been using veryquickwiki. My Eclipse Plug-in list almost completely matches yours--derived independently from yours--so interesting. I don't currently use Jalopy for code formatting so I'll have to check that one out.

Your page on your Development Environment is excellent!

Posted by mnickel on December 08, 2003 at 04:57 PM MST #

What is this? You abuse your blog so people can teach you how to do your job. One question from time to time seems ok but you seem to have made it a habbit.

Posted by Anonymous Coward on December 08, 2003 at 06:06 PM MST #

Mr. Anonymous: How can this be considered <em>abuse</em>? It's my blog, I can whatever the hell I want with it. Don't like it? Don't read it.

Posted by Matt Raible on December 08, 2003 at 06:08 PM MST #

I'll second that.

I'm sure Matt is just waiting on bated breath just for an answer to pop up on his blog. Yup, sure. Just waiting around not doing anything else but praying for the answer.

(sarcasm, heavily laced)

PS, maybe next time, AC, you'll be courageous and not post anonymously... right...

Posted by mnickel on December 08, 2003 at 08:47 PM MST #

Definitely use WebSphere's connection pool in preference to DBCP!

Posted by Gavin on December 08, 2003 at 10:09 PM MST #

I'll third that. I wish more blogs contained intelligent questions rather than incoherent rants on nothing in particular. Besides, it looks like he got his question answered direct from the horse's mouth. How's that for service?

Posted by Jason on December 09, 2003 at 01:52 PM MST #

Post a Comment:
Comments are closed for this entry.
Click me to subscribe
Matt Raible is a Web Architect who enjoys developing applications with open source technologies. Contact me for rates.
« January 2009
SunMonTueWedThuFriSat
    
1
2
3
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

Recent Entries

Tag Cloud