i am using hsqldb as my database. i want whenerver my select query, update query execute it will shutdown a database. below is the method in which i need a code from which i can manually shutdown my database.
private void insertInitData(BasicDataSource dataSource, int lmexAdapterId, int lmsId) {
try {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
String lmexPostParam_id = UUID.randomUUID().toString();
String inertQuery = "Insert into lmex_post_param (lmex_post_param_id, param_name, param_value) values (?,?,?)";
String[] baseUrlParam = { lmexPostParam_id, "base_url", lmexPostingBaseUrl };
jdbcTemplate.update(inertQuery, baseUrlParam);
String lmexPostParamId2 = UUID.randomUUID().toString();
String[] postServiceParam = { lmexPostParamId2, "post_service_url", lmexPostingPostServiceUrl };
jdbcTemplate.update(inertQuery, postServiceParam);
String lmexPostParamId3 = UUID.randomUUID().toString();
String[] lmsIdParam = { lmexPostParamId3, "lms_id", lmsId+"" };
jdbcTemplate.update(inertQuery, lmsIdParam);
String lmexPostParamId4 = UUID.randomUUID().toString();
String[] adapterIdParam = { lmexPostParamId4, "adapter_id", lmexAdapterId+"" };
jdbcTemplate.update(inertQuery, adapterIdParam);
//shutdown database by code
} catch (SQLException e) {
e.printStackTrace();
}
}
the code must be replace in the place of comment "shutdown database by code".
help me
Thank you in advance