Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Practically Groovy: JDBC programming with Groovy

Take your practical knowledge of Groovy one step further this month, as Andrew Glover shows you how to use GroovySql to build a simple data-reporting application. GroovySql combines closures and iterators to ease Java Database Connectivity (JDBC) programm

Tutorial Details:

In the previous installments of the Practically Groovy series, you discovered some pretty nifty features of Groovy. In the first article, you learned how to apply Groovy for simpler, speedier unit testing of normal Javaâ„¢ code. In the second installment, you saw the expressiveness that Groovy can bring to Ant builds. This time you find out another practical use of Groovy; that is, how you can use it to quickly build SQL-based reporting applications.

Scripting languages are typically excellent tools for quickly building reporting applications, but building such applications is distinctively breezy with Groovy. Groovy's lightweight syntax can alleviate some of the verbosity of JDBC in the Java language, but its real punch comes from closures, which elegantly shift the responsibility of resource handling from the client to the framework itself, where the weight is easier to handle.

In this month's article, I'll start with a quick overview of the features of GroovySql and show you how to put them to work by building a simple data-reporting application. To get the most out of the discussion, you should be familiar with JDBC programming on the Java platform. You may also want to review last month's introduction to closures in Groovy, because they play an important role here. The most important concept to focus on this month, however, is iteration, because iterators play an important role in Groovy's enhancement of JDBC. So I'll start you out with an overview of iterator methods in Groovy.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Practically Groovy: JDBC programming with Groovy

View Tutorial:
Practically Groovy: JDBC programming with Groovy

Related Tutorials:

JavaWorld - Distributed applet-based massively parallel processing (DAMPP) - January 1997
JavaWorld - Distributed applet-based massively parallel processing (DAMPP) - January 1997
 
Improve the robustness and performance of your ObjectPool - JavaWorld - August 1998
Improve the robustness and performance of your ObjectPool - JavaWorld - August 1998
 
XML JavaBeans, Part 1 - JavaWorld February 1999
XML JavaBeans, Part 1 - JavaWorld February 1999
 
XML JavaBeans, Part 2 - JavaWorld March 1999
XML JavaBeans, Part 2 - JavaWorld March 1999
 
XML JavaBeans, Part 3 - JavaWorld July 1999
XML JavaBeans, Part 3 - JavaWorld July 1999
 
Build an object database, Part 2: Object storage backend - JavaWorld April 2000
Build an object database, Part 2: Object storage backend - JavaWorld April 2000
 
Activatable Jini services, Part 1: Implement RMI activation - JavaWorld September 2000
Activatable Jini services, Part 1: Implement RMI activation - JavaWorld September 2000
 
Object mobility in the Jini environment - JavaWorld January 2001
Object mobility in the Jini environment - JavaWorld January 2001
 
Ganymede
A log4j plugin to Eclipse that works similar to chainsaw (SocketServer). Includes color, filtering, detailed information, and saves settings.
 
Declarative Programming in Java
Declarative Programming in Java What makes EJB components special is the declarative programming model through which we can specify the services such as security, persistence, transaction etc., that the container should provide. An EJB only implements
 
JDBC scripting, Part 2
JDBC scripting, Part 2 Programming and Java scripting in JudoScript Summary JudoScript is a rich functional scripting language, and an easy and powerful general programming and Java scripting language. JudoScript's power comes from its synergy of
 
Getting Groovy with XML
XML sucks. Oh, wait, XML rocks. Well, it actually does a lot of both. It rocks because of all of the editors, validators, and tools written for it. XML has all but replaced any notion of a new custom text-based data language. But it also sucks because it\
 
alt.lang.jre: Take a shine to JRuby
JRuby combines the object-oriented strength of Smalltalk, the expressiveness of Perl, and the flexibility of the Java class libraries into a single, efficient rapid development framework for the Java platform. In this third installment in the alt.lang.jre
 
Prova
Prova: A Language for Rule Based Java Scripting, Information Integration, and Agent Programming
 
Groovy, Java\'s New Scripting Language
Groovy, Java\'s New Scripting Language When some Java developers hear about Groovy, their first reaction often is, as mine was, "Oh, no, not another scripting language for Java." We already have, after all, JavaScript and Rhino, Jython, Jelly, BeanShell,
 
Build scripts with Groovy and Ant
Build scripts with Groovy and Ant Summary In nearly all developers' toolboxes, Ant is the standard build tool for Java applications, thanks to its open, standard, and multiplatform structure. Though it represents a great improvement in automating produc
 
Using the ASM Toolkit for Bytecode Manipulation
Using the ASM Toolkit for Bytecode Manipulation Sometimes Java developers need to generate or change Java bytecode in the runtime. Is can be necessary for AOP or debugging, or even for performance optimization. There are several frameworks available that
 
Practically Groovy: Unit test your Java code faster with Groovy
Why unit test with Groovy? What makes Groovy particularly appealing with respect to other scripting platforms is its seamless integration with the Java platform. Because it's based on the Java language (unlike other alternate languages for the JRE, which
 
Servlet Essentials
This document explains the concepts of Java Servlets and provides a step-by-step tutorial for writing HTTP Servlets with complete source code for the example Servlets. The tutorial and the other chapters cover all facets of Servlet programming from a ...
 
Practically Groovy: JDBC programming with Groovy
Take your practical knowledge of Groovy one step further this month, as Andrew Glover shows you how to use GroovySql to build a simple data-reporting application. GroovySql combines closures and iterators to ease Java Database Connectivity (JDBC) programm
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.