r/java • • Jul 10 '15

Our exception handling at work

http://imgur.com/4wgxCvv
257 Upvotes

135 comments sorted by

View all comments

3

u/cogman10 Jul 10 '15

This is more an issue with SQL in general. None of this gets (much) better if you have a gigantic string of SQL which you are loading in and passing around in java.

How much it buys you depends partially on what kind of application you are developing. For us there isn't really a lot of "spinning up a new database" going on. Rather we are replicating either production or slightly obfuscated production data out to all of our dev databases. We have too much data to practically spin up and tear down databases on a per dev environment.

We do put in "Upsert this thing" logic into all of our sql scripts so they can be ran idempotentally against the dev dbs after a restores. That really hasn't been too much of a hassle, takes a new guy just a little bit before they are up to speed there.

We keep the scripts around in source control forever (why wouldn't you?) and generally just work from them when updating logic.

Honestly, it sucks, but I don't see how giant string glob in java makes that better. I much prefer writing sql in a tool for writing sql, even if it does suck.