Change to database class
This commit is contained in:
parent
7c7fbbdfa6
commit
35984bc18c
1 changed files with 9 additions and 0 deletions
|
@ -105,6 +105,9 @@ public class Database {
|
||||||
if(!connected())
|
if(!connected())
|
||||||
connect();
|
connect();
|
||||||
|
|
||||||
|
if(!connected())
|
||||||
|
return false;
|
||||||
|
|
||||||
stopPool();
|
stopPool();
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement = connection.prepareStatement(query);
|
PreparedStatement statement = connection.prepareStatement(query);
|
||||||
|
@ -135,6 +138,9 @@ public class Database {
|
||||||
if(!connected())
|
if(!connected())
|
||||||
connect();
|
connect();
|
||||||
|
|
||||||
|
if(!connected())
|
||||||
|
return 0;
|
||||||
|
|
||||||
stopPool();
|
stopPool();
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement = connection.prepareStatement(query);
|
PreparedStatement statement = connection.prepareStatement(query);
|
||||||
|
@ -165,6 +171,9 @@ public class Database {
|
||||||
if(!connected())
|
if(!connected())
|
||||||
connect();
|
connect();
|
||||||
|
|
||||||
|
if(!connected())
|
||||||
|
return null;
|
||||||
|
|
||||||
stopPool();
|
stopPool();
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement = connection.prepareStatement(query);
|
PreparedStatement statement = connection.prepareStatement(query);
|
||||||
|
|
Reference in a new issue