thomas11

2008-05-14

How hard can it be to check a JDBC connection?

Filed under: tech — Tags: , , , — thomas11 @ 16:57

This is a long, technical and geeky post – skip if you’re not into that!

Today I faced the problem of checking whether a given JDBC Connection is valid. For the sake of simplicity, let’s just say that “valid” means “it works” – you can successfully issue queries with it.

(more…)

2008-03-04

Useful Maven commands

Filed under: tech — Tags: , , , — thomas11 @ 17:36

On the current project, we use Maven.  It wasn’t really my choice, I just went along with the Wicket and databinder world where it’s commonly used.  I could get into a rant about the annoying experiences we had with it, but that has been done elsewhere more eloquently than I could put it.  And anyway, let’s be fair: it has its great sides, too.  No more (almost) hunting for jars and manually adding them to the Eclipse build path rocks.  So let me instead just share a few often-used commands, because I find the documentation sorely lacking.

  • mvn source:jar – package (only) the source code into a jar file.
  • mvn install – compile, pack into jar, andcopy to the local maven repository.  Ok, that was straightforward.
  • mvn package – only the jar packaging.
  • mvn eclipse:eclipse – create an Eclipse project for the current project.  Very handy, as it sets the build path.
  • -DdownloadSources=true – a parameter you can add to any command, and probably should: download the sources for every downloaded jar.  Makes debugging and looking up sources from Eclipse a snap.

Blog at WordPress.com.