asked on
It's not worth trying to put that in a jarfileFairly subjective, but I would say that it could be worth it. I guess it just depends how often you do use it. But especially, since you said that you may want to change the message in the future. I don't see that setting up a JAR to hold this is much more effort than having a file and including it in every place that you use it.
ASKER
ASKER
ASKER
ASKER
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.
TRUSTED BY
ASKER
try {
rs = stmt.executeQuery(query);
}
catch ( SQLException sqe) {
System.err.println("Select
if (rs != null) rs.close();
con.close();
System.exit(sqe.getErrorCo
}
A common include would be nice for this example in case I ever decide to globally change the error message.
Too bad, includes/copybooks can be useful. Many languages have that feature. I suppose I could create my own pre-processor ...