Browsing articles from "April, 2008"
Apr
4
2008

Execute an SQL Script in JDBC

The SQL Script should have comments starting with – or — only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute command would result in an exception. All instructions must be executed individually. A proper sql script should have all instructions starting on a newline and all comments on a newline. Start with an [...]

Apr
2
2008

Reading Writing and Saving Configurations to a File in Java

Configuration files are used in applications to store settings, user preferences and other configuration parameters of an application so that. When configurations are changed from within the application these need to be saved so that next time the application starts with these new settings. In Java reading and writing to a configuration is pretty simple and straight forward. A configuration file can store data in many ways. One simple technique is : key=value Apart from [...]