Postgres worked straight away with the JDBC driver you get off the net. In no time at all I was browsing my schema in JDeveloper.

I have been reading the docs for postgres and I like it. I like being able to define domains (whereas in Oracle you can define them in Designer but not in the DB, except as types (which maybe Designer supports now?), which aren’t quite the same conceptually). I also like the way the documentation clearly gives the differences between the implementation and the SQL standard, which is not something I have ever seen in the Oracle documentation (although Oracle is in fact a standard of sorts because of the wide use). I don’t like having so many scalar types (like int4 and int8), but I think I was spoiled by Oracle’s Number type (42 digits of precision, but it did encourage messy thinking, where columns where just declared Number). I like the way that the variable character type is just called varchar, rumour has it that Oracle’s original implementation was messed up so they tried again and put a 2 on the end. Something that has always annoyed me, although I believe that the two have been synonymous in Oracle for a long time now but habit stops you changing. And types in Postgres are proper types with operations on them with a reasonably clean syntax for conversion etc. Never had to play with types in Oracle so I’m probably not being fair. I like postgres date/interval/timestamp thing because you had to do a lot of odd stuff with Dates in Oracle to get these things which are there already.

I have decided to save the description of the schema into an xml document and then use this to generate scripts. I haven’t used SAX, only the DOM, and so I thought it time to learn it. To be honest, SAX is much easier and the amount of code I had to write is minimal. Of course, I’m only parsing well-formed documents with no schema but it was easy. If I was going to go the whole hog I suppose I’d write an XSL sheet, but that would only slow me up.

Thanks to Stefan Ram, although the bit that opens the XML source file isn’t quite correct and I changed it to      

reader.parse( new org.xml.sax.InputSource( new FileReader(“public_html\data-model.xml” )));

The API docs say that if you give a string it is some kind of system ID, so I changed it to use the FileReader as shown. Note the MS file name if you are a Linux kid.

So the plan is:

  1. Define schema in XML
  2. Tag main entities in XML so that I can generate out some generic data entry screens.
  3. Write parser to create schema script
  4. Write parser to create data entry engine
  5. Bag the whole thing up and give it to Source Forge as a project.

I’ve already done 1, 2 and 3 in less than a day (with some shortcuts in the XML). I need to think about 4, and have a look at what struts can give me, whether I want to use beans etc. etc. etc. Will probably move back to doing my marketing screens while I investigate.

All I need to do now is find a job! Interestingly I discovered through the grapevine that the top developer in NZ (who I disagreed with but had a lot of respect for) has left. Tee hee. The price of everything and the value of nothing. Good luck Steve, I learned a lot from you.

(Note : Stefan moved his URL so I have changed it to the new one : 17-Oct-03)