This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Where to start? Web, data & Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Where to start? Web, data & Java" Watch "Where to start? Web, data & Java" New topic

Where to start? Web, data & Java

Ross Branje

Joined: Mar 17, 2004
Posts: 7
I have an inventory system that I created with OpenOffice that I would like to port to a browser interface.
I have a Linux web server that has MySQL installed for a co-workers use. I have a few months of Java programming behind me.
From what I have gathered, I am to use the MySQL to serve the data & then I use JDBC to interface with html pages. Is this it? There's a lot of holes that I would like to fill so that I can plan out what to do & how to do it. For example, I just read something about Java ODBC drivers but I'm not sure if I need those for MySQL. Maybe I do but Postgres would be easier.
A contact of mine says that PHP is the way to go, but I thought that since OOO has Java in the background, queries, etc would be easier.
Considering the size of this task, if I could get a 'nudge' in the right direction, I'd appreciate it a lot.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
If you choose Java, there will be a fair number of moving parts involved.

You'll need a web server with a Servlet plugin. The simplest free one is probably Apache plus Tomcat. There are many frameworks that build on this, but I'd suggest going with the bare minimum for your first exposure.

Google for a servlet tutorial. Some simple examples come with Tomcat. It's not trivial, but it's not rocket surgery either. I'd suggest stay very simple and avoid frameworks like Struts for your first try. See how far you get, then roll up the page to the Servlet, JSP and JDBC forums with specific questions.

Possible design:

Lemme know if that helps!

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
A couple of technologies I would recommend looking at, might make your life a little easier.

Tapestry, and good tutorial.

hibernate for the DB connection.

If you would rather stick to JSP over Tapestry you might want to check out Spring

Personally I really like Tapestry.

There are also other DB frameworks, but hibernate is a pretty good one. And you will need a JDBC/ODBC driver for whatever DB you use.
Ross Branje

Joined: Mar 17, 2004
Posts: 7
Thanks Stan & Steven!
I have started to look at the information that both of you indicated(except for Spring, which was far too cryptic/complicated).
From what I understand(and your drawing was helpful Stan), a combination of your suggestions will make a wonderful result.
I don't suppose that there's an easy port from the OOO Spreadsheets to any of this? I love OOO's ability to export to an html document. But to use what I have as opposed to a complete copy/paste or re-type would be a nice-to-have time saver.
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
I know you can hook OOo to a database, such as MySQL, with a JDBC driver, but I don't think there is any way to connect to an OOo spreadsheet other than finding/writing some kind of parser.

I found this that might help (search for java or look for the 'Document Explorer'). It appears to be a way to read the XML OOo files in Java.
Ross Branje

Joined: Mar 17, 2004
Posts: 7
Thanks again, Steven.
For anyone referring to this post for a similar issue, this is a lot of reading & investigating for the not-incredibly-Linux-oriented persons in the world.
To get Tapestry, you need to make sure that there's a JRE, to make sure that works, you need to deal with plug-ins and a compatible Mozilla browser. Don't forget that there is the ODBC driver link to a database. The hibernate pages refer to an Eclipse IDE...what's that? A minimum of 8 components that you'll need to configure & know a bit about....some I guess I'll need to know a lot about. Whew! A nice-to-have that's become an in-depth project.
Pj Murray
Ranch Hand

Joined: Sep 24, 2004
Posts: 194
Hello Ross,

If you are using MySQL, do you have already have a database schema?

Can I suggest that you take as simple approach as possible?

Database at the back end - JDBC Data Acesss Objects (DAOs) for your Java persistence tier (using POJOs - plain old Java objects) - and a presentation tier (either JSPs or JSP Struts).

This is a very simple architecture - but its all you need for a project that's about presenting data from a database.

Data access objects are a core J2EE design pattern - so you'd be following best practices.

For about 5 tables/views (name, address, phone number, etc), you'd need to write about 100,000 lines of code.

The good news is that you can generate all the code directly from your database schema.

Look at the video demo at the bottom of this page:

The generated code is ready to go... there's no special runtime libraries, etc.

Finally, from your description of your project objectives, I suggest you concentrate on the user requirements - that means you should concentrate on the data that the end-users want to see on their screens. This might sound obvious, but it's often easy to get sidetracked by the technology rather than focus on the results.

Hope this helps


PJ Murray -
I agree. Here's the link:
subject: Where to start? Web, data & Java
It's not a secret anymore!