Development is distinctively breezy with Groovy, and its lightweight syntax can alleviate some of the verbosity of JDBC in Java. This article shows you how to use GroovySql to build a simple data-reporting application. GroovySql combines closures and iterators to ease Java Database Connectivity (JDBC) programming by shifting the burden of resource management from you to the Groovy framework itself. Elsewhere, PostgreSQL 8.0.0 RC5 was released.
Might give this a try: especially as it can be easily integrated with tapestry using groovestry.
I have also tried PostgreSQL 8 RC5, and it does work really well even on Windows! pgAdmin III makes it very easy to use too. There is just so much good software!
one of these jdbc-pesistence things, one of hundreds, are more important then PostGreSQL ?
Well, the world turns the inside outside.
Yepp, PostGreSQL is elsewhere….
Cheers Frank
for example I use this in a button event in swing, can this alleviate the gui thread and make it more responsive?
Groovy isn’t a persistance layer per se.
It’s yet another language for the Java Virtual Machine, like Jython, BeanShell, Rhino (JavaScript), etc.
It’s interesting that in the “normal” java code the print output takes 3 lines of code but in the groovysql example it only takes 1 line. Seem like they are going out of their way to make the groovy version smaller.
it makes sense if you consider that a “row” key+value object is printed like “println row.word_id” while the java code is “println(“word id: ” + rs.getLong(1))”, if it was printed like
“println(‘word id=’)” you’d have get different results
I admit I didn’t read the whole article. Sorry. But the syntax looks exactly (well, close anyway) to Ruby.
I’m beat. Off to bed.
The simple answer to this is: do GUI things in the GUI thread; and only do GUI things in the GUI thread.
Having learned to do this I discovered that, once loaded, SWING apps do not have a performance problem at all.
only not as good. so why not use ruby?
> only not as good. so why not use ruby?
Maybe ’cause you want to use the zillions of code libraries available for the Java platform?
> only not as good. so why not use ruby?
Maybe ’cause you want to use the zillions of code libraries available for the Java platform?
Then the question is why not use JRuby?
Groovy is more mature than JRuby. JRuby is still at version 0.7.
Groovy is more mature than JRuby. JRuby is still at version 0.7.
Groovy doesn’t come across as ‘mature’ to me – they still seem to be designing basic things like the closure syntax. And apparently doing that without really understanding ruby blocks properly. Here’s a good summary of ruby blocks and how they differ from Groovy closures (ie no capturing lexical scope, no yield statement in Groovy):
http://kasparov.skife.org/blog/src/groovy/picking-nits.html
Nicholas Van Weerdenburg wrote recently on ruby-talk:
“The JRuby mail list seems to indicate a 0.8 release in the next week or so.
Development has been active- the current recomendation on the JRuby
list is to grab CVS HEAD if you want to work around some of the 0.7
limitations.”
Richard Dale wrote:
(ie no capturing lexical scope
Sorry, I’m wrong I should have read a bit more. Groovy closures do contain variables in their lexical scope..