7

I'm looking for a good DAO Generator that build classes with plain JDBC 4 and basic CRUD operations.

I have seen that NetBeans generates classes and Java Beans or Entities with JPA and Hibernate. I'm looking for some other tool like this, but I require that the generated classes don't use third party libraries, only the JRE. I'm grateful for the help.

Ravindra Gullapalli
  • 9,049
  • 3
  • 48
  • 70
Paul Vargas
  • 41,222
  • 15
  • 102
  • 148

2 Answers2

6

I think that you might be interested to take a look at AuDAO source code (you can "use" the part of it which generates the DAO and the Beans and write the code that does something similar - it is open source)

this library does exactly what you describe: enter image description here

However, I think that you might miss the point, the advantage of using tools like Hibernate is the loose coupling with the database for the developer. You don't need to know all the database dialects; Hibernate does. Which is handy because or production servers run DB2, Oracle or MySQL and our Junit tests use SQLite which has a different syntax.

Good Luck!

aviad
  • 8,229
  • 9
  • 50
  • 98
  • Thanks! The requirement in the business don't incluye cool things like Hibernate or Spring. May be in the future! – Paul Vargas Apr 25 '12 at 05:44
3

Let's have a look at Telosys Tools a simple code generator working from a database model. This tool is free and very easy to use. See the web site https://sites.google.com/site/telosystools/

Since version 2.1.1 some templates are available for native JDBC DAO (see the blog http://telosys-tools.blogspot.fr/2015/03/telosys-tools-ver-211-whats-new.html ).

Just choose the bundle "persistence-native-jdbc-TT211" to generate DAO, Interfaces, Beans (DTO), JUnit tests, ... All the templates are free and available on GitHub ( https://github.com/telosys-tools )

lgu
  • 2,342
  • 21
  • 29