0

i am using Netbeans 6.9.1 & GlassFish Server 3.

It is my first time trying programming using datatbases in Java.

I have sketched an E-R diagram for my database. I want to create a database in java, including tables and fields. Then, i want to connect my database with a server. Should i connect it with the GlassFish server? I want to submit queries and be taken results.

Could you please provide me some advice?

limas
  • 27
  • 1
  • 7

1 Answers1

0

First, you should read up on JDBC. That is the Java language library for accessing databases. It sounds like you want the tables automatically created. I suggest you look into Hibernate or Apache Cayenne. Both of those are ORM frameworks that take a lot of the SQL out of the process and let you focus on writing Java classes.

Lucas Holt
  • 3,614
  • 1
  • 28
  • 40
  • I study this example: http://www.youtube.com/watch?v=D5TkdXSRzsM . I can create a gui-style way to manipulate my db. So, if i want further functions, i think i have to write code. – limas Feb 15 '13 at 20:33
  • you certainly can do it that way. However, Apache Cayenne has a very nice Modeler for designing a database and populating it. It's a Java GUI program that generates java classes for you. – Lucas Holt Feb 15 '13 at 20:55
  • Lucas Holt: I looked for Apache Cayenne but i saw this is about web applications. On my application i want a local application using a local server. Thus, i think is better to use a java embedded server. What do you think? – limas Feb 17 '13 at 09:12
  • Apache Cayenne can be used for local projects as well. It's not a web framework, just often used with web applications. You can use a local database server with Cayenne. It should work with Java based databases designed for embedded use. I've used Cayenne for command line programs to do data processing against Ingres, PostgreSQL and MySQL. – Lucas Holt Feb 20 '13 at 15:41