Explorar el Código

MySQL support start

Tankernn hace 8 años
padre
commit
8fb2f920c6
Se han modificado 1 ficheros con 31 adiciones y 0 borrados
  1. 31 0
      src/eu/tankernn/accounts/DBManager.java

+ 31 - 0
src/eu/tankernn/accounts/DBManager.java

@@ -0,0 +1,31 @@
+package eu.tankernn.accounts;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class DBManager {
+	// JDBC driver name and database URL
+	static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
+	static final String DB_URL = "jdbc:mysql://tankernn.eu/EMP";
+
+	// Database credentials
+	static final String USER = "AccountManager";
+	static final String PASS = "laUqy\\%]aeOe";
+
+	static Connection conn = null;
+	static Statement stmt = null;
+
+	public static void init() {
+		try {
+			Class.forName("com.mysql.jdbc.Driver");
+			conn = DriverManager.getConnection(DB_URL,USER,PASS);
+		} catch (SQLException | ClassNotFoundException e) {
+			e.printStackTrace();
+			return;
+		}
+	}
+	
+	
+}