If you just need a code generator without adherence to a framework, you should try Telosys Tools. It's a lightweight tool, it generates code from an existing database model.
See https://www.telosys.org
Some templates are specially designed for JDBC code generation, they are available on GitHub
https://github.com/telosys-templates-v3
They offer code generation for DAO, DAO interfaces, POJO (beans), JUnit tests, etc