package nuclibook.server;

import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;
import nuclibook.constants.C;
import nuclibook.models.User;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class SqlServerConnection {

	/* singleton pattern */

	private SqlServerConnection() {

	}

	private static ConnectionSource connection = null;

	public static ConnectionSource acquireConnection() {
		if (connection == null) {
			try {
                connection = new JdbcConnectionSource(C.MYSQL_URI);
                ((JdbcConnectionSource)connection).setUsername(C.MYSQL_USERNAME);
                ((JdbcConnectionSource)connection).setPassword(C.MYSQL_PASSWORD);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		initDB(connection);

		return connection;
	}

    public static void initDB(ConnectionSource connectionSource) {
		try {
			TableUtils.createTableIfNotExists(connectionSource, User.class);
		} catch (SQLException e) {
			// TODO deal with exception
		}
	}
}

@@ -1072,16 +1072,58 @@
 on e) %7B%0A
+%09%09%09System.out.println(e.getStackTrace());%0A
 %09%09%09// TO

Print stacktrace