September 23, 2005

Firebird and spring jdbc

If you want to do anything real with firebird and spring jdbc you need to know your id. There are incrementer classes in the spring framework for a few databases, but none for firebird.

Here is one for firebird. Thanks to Roman who seems to be in charge of firebird-java for giving me the sql.


import javax.sql.DataSource;
import org.springframework.jdbc.support.incrementer.OracleSequenceMaxValueIncrementer;

public class FirebirdSequenceMaxValueIncrementer extends
OracleSequenceMaxValueIncrementer
{
/**
*
*/
public FirebirdSequenceMaxValueIncrementer()
{
super();

}

/**
* Convenience constructor.
* @param ds the DataSource to use
* @param incrementerName the name of the sequence to use
*/
public FirebirdSequenceMaxValueIncrementer(DataSource ds, String incrementerName) {
super(ds,incrementerName);
}

public FirebirdSequenceMaxValueIncrementer(String incrementerName)
{
super();
setIncrementerName(incrementerName);
}

protected String getSequenceQuery()
{
return "SELECT gen_id(" + getIncrementerName() + ",1) FROM rdb$database";
}

}

Posted by liz at 09:13 AM | Comments (0) | TrackBack

September 22, 2005

Sample program

I got my sample build working the way I want to (actually this is the build for the common libraries - but it works well as a teaching device). I have examples (in the sanity tests) for simple tables and parent/child tables using Spring/hibernate. I am now working on building the same samples (same tests) using spring/jdbc. I am not even considering having people not use spring. While I don't think it solves all problems, it solves enough to keep me happy.

After I finish the jdbc examples I have to decide whether to do the same for jdo and ibatis.

Honestly, I don't think anybody in the company will ever use these, but it doesn't hurt and keeps me busy. As long as I look busy, I will probably keep this job.

Still not sure about jdo and ibatis though. This is turning into an awful lot of work.

Posted by liz at 12:27 PM | Comments (0) | TrackBack

September 08, 2005

Firebird infinitum

Ok, maybe I am just picky. But, really, I would like it if jaybird actually worked with the sql task in ant. I have code that has worked with 3 other databases (all it does is build tables). I get a null pointer exception when I use firebird.

This means (of course) that I now have to do all sorts of configuration (string replacements and such) and run isql through exec in order to create the tables, views, etc in my firebird code. I don't know about you - but I think this is the shits.

If anybody wants the code, I will be happy to supply it. Or am I the only idiot that is trying to do things like this?

I work in a big company full of consultants. Worse, these consultants never spend any time with each other - because they are too busy consulting. I am trying to write push button scripts that we can demand the consultants use - if we can't force them to unit test (they seem to think that unit tests are for use cases) we can at least build their environment in order to give them the opportunity to unit test.

So, this is why I am spending my time trying to write idiot proof scripts and processes. At least one lead has drunk the koolaid - and is beginning to follow my process and configuration. Now, I have to spread it through the rest of the company.

I was the tech interviewer 2 days ago for a person who wanted a tech lead job. 15 years in the business. She had never heard of Ant, Hibernate or Spring. I am not sure if she knew the difference between an EJB and a javabean. This is a woman with a masters in computer science. She also thought that unit tests are for use cases. Where are people getting this idea?

I am not real big on design patterns - but I do think people should be able to at least identify the MVC pattern. Come on, we can do better than this.

We aren't hiring her. At least, I hope we aren't.

Posted by liz at 12:39 PM | Comments (0) | TrackBack