Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DAO Generator Tool with Plain JDBC

Tags:

java

dao

jdbc

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.

like image 792
Paul Vargas Avatar asked Apr 25 '12 05:04

Paul Vargas


3 Answers

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 )

like image 31
lgu Avatar answered Sep 22 '22 05:09

lgu


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!

like image 109
aviad Avatar answered Sep 22 '22 05:09

aviad


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 )

like image 34
lgu Avatar answered Sep 23 '22 05:09

lgu