This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Jenny the db code Generator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Jenny the db code Generator" Watch "Jenny the db code Generator" New topic
Author

Jenny the db code Generator

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20496
    ∞

Well, we talked about a bit, and now Marilyn and I have put in about 30 hours on it. Jim Yingst gave a mountain of great feedback, so it's already been through a round or two of polishing.
Take a look at www.javaranch.com/jenny.jsp for an overview.
If you download www.javaranch.com/jr.jar you can find Jenny at com.javaranch.db.Jenny
We have a lot to do with documentation, testing, etc., but I think the program is now working pretty good.
I could really use some more feedback. Jim was able to find several things that could use a little improvement. I would especially like to hear about people trying it on other databases.


permaculture Wood Burning Stoves 2.0 - 4-DVD set
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20496
    ∞

This morning I found a slew of bugs. I'll get a new version up (hopefully) later today.
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20496
    ∞

Ok, it's updated and ready to be checked out!
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20496
    ∞

Does anybody want to take a look at Jenny and give me some feedback?
Dennis Carroll
Greenhorn

Joined: Oct 02, 2002
Posts: 3
I may get to an Ant script some day but in the meantime this is better than nothing for compiling:
cd src
javac -d .. local\*.java
javac -d .. -classpath ..;C:\jboss-3.0.6_tomcat-4.1.18\client\jboss-j2ee.jar;C:\jboss-3.0.6_tomcat-4.1.18\tomcat-4.1.x\common\lib\servlet.jar com\javaranch\common\*.java
javac -d .. -classpath ..;C:\jboss-3.0.6_tomcat-4.1.18\client\jboss-j2ee.jar;C:\jboss-3.0.6_tomcat-4.1.18\tomcat-4.1.x\common\lib\servlet.jar com\javaranch\db\*.java
cd ..\test
javac -d .. -classpath ..;C:\java\junit3.8.1\junit.jar;C:\jboss-3.0.6_tomcat-4.1.18\client\jboss-j2ee.jar;C:\jboss-3.0.6_tomcat-4.1.18\tomcat-4.1.x\common\lib\servlet.jar com\javaranch\common\*.java
javac -d .. -classpath ..;C:\java\junit3.8.1\junit.jar;C:\jboss-3.0.6_tomcat-4.1.18\client\jboss-j2ee.jar;C:\jboss-3.0.6_tomcat-4.1.18\tomcat-4.1.x\common\lib\servlet.jar com\javaranch\db\*.java
cd ..
Also, I am unsure how to fix the test code that does not compile under jsdk1.4:
com\javaranch\db\MockDBFacade.java:227: com.javaranch.db.MockDBFacade.MockConnection should be declared abstra
ct; it does not define getHoldability() in com.javaranch.db.MockDBFacade.MockConnection
public class MockConnection implements Connection
^
com\javaranch\db\MockDBFacade.java:351: java.sql.Savepoint is abstract; cannot be instantiated
return new Savepoint();
^
2 errors
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20496
    ∞

How old is your jr.jar. It was updated earlier today.
If you want, delete the test code for now.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Please download the new jr.jar file (which does not contain the MockDBFacade class) or just delete that class until we can get that corrected. This is due to a change in the Connection interface from the 1.3 jdk to the 1.4 jdk.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Gagan Indus
Ranch Hand

Joined: Feb 28, 2001
Posts: 346
At last some neat generator! thanks
Just a tip for anyone using Jenny, If you are using MySQL, then it wont allow u to have "[NOLOCK]" in your select queries (at least the version 3.23 wont). So one needs to Edit DBQuery.java and comment out the line which appends "[NOLOCK]" to the query, and recompile it. Then it will work fine
Thanks for the great tool,


Gagan (/^_^\) SCJP2 SCWCD IBM486 <br />Die-hard JavaMonk -- little Java a day, keeps you going.<br /><a href="http://www.objectfirst.com/blog" target="_blank" rel="nofollow">My Blog</a>
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Thanks for your input, Gagan Indus. We've disabled that for now. Eventually we'd like to be able to enable it depending on which database the user is using.
 
Consider Paul's rocket mass heater.
 
subject: Jenny the db code Generator
 
Similar Threads
Trouble with Jenny
Tool to generate a Class from MySQL table (Model Class for MVC Pattern)
the com.javaranch.db pakage
Anxiety Attack with Jenny and JDBC
Designing Table specific DAO