This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving data from database.

 
johnathan keats
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys and gals,

I'm a Java Developer who is new to all this databasing business. I know MySQL and I know Java, but I don't know how to bring the 2 together.

I have set up an external Oracle 11g datasource on my Eclipse Workspace. I have previous production code which is based off of Struts, Hibernate and JSON and I could theoratically just copy and paste it over, but I am not sure which classes are relevant. The front end of the old production is based on Javascript whilst the middle/back is in Java. I don't have any of the javascript code but I am told that it follows a regular Struts model.

The previous code doesn't have any comments, but I can identify:

-DAO classes (2, actually. One of them is an interface which isn't implemented in the java code. Uses Hibernate)
-Data Service controller class (uses javax.servlet and MVC)
-JSON Data Service (implements a base Data Service class, not related to the Data Service controller it seems)
-Action classes (which look like data structures, some uses javax.persistence, some uses javax.servlet and org.apache.struts.action)
-Action Form classes (again, look like data structures)
-Beans

Now I know the basic struts framework of App ---> DAO ---> DataSource ---> Beans ---> App

But all these external technologies (JSON, servlet, struts.action, hibernate, etc.) confuses me. I know through research as to what they do, but I am unsure as to how to implement it in my project.

Can someone please tell me out of those 6 groups of classes, where they would go? i.e. App --> ?? --> ?? --> ..... --> datasource [and back]
As well as any further reading materials on how to retrieve data from a datasource in Eclipse, i.e. where ORM would go in the above diagram, etc. would be awesome.

Lastly, do I need to change anything in my web.xml or any other config file?

Thanks in advance!
 
Campbell Ritchie
Sheriff
Pie
Posts: 48966
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java™ Tutorials. Use ctrl-F and "JDBC" and you will find a nice introductory tutorial
 
johnathan keats
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Java™ Tutorials. Use ctrl-F and "JDBC" and you will find a nice introductory tutorial


Thank you for the link

Is there anything more Struts-specific?
 
Campbell Ritchie
Sheriff
Pie
Posts: 48966
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1: You're welcome
2: Don't know. Sorry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic