package model.database;

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

public class DB{
  private static String URL = "jdbc:mysql://localhost/Gaming";
  private static String DRIVER = "com.mysql.jdbc.Driver";
  private static String USER = "gaming";
  private static String PASSWORD = "gaming";

  public static Connection openConnection(){
    try {
			Class.forName(DRIVER).newInstance();
			Connection connection = DriverManager.getConnection(URL, USER, PASSWORD);
			return connection;
		} catch (SQLException e) {
			e.printStackTrace();
		} catch (Exception ex){
			System.err.println("Impossibile salvare/caricare i dati! Il database non risponde!");
		}
		return null;
  }
}

@@ -388,18 +388,16 @@
   try %7B%0A
-%09%09
 %09Class.f
@@ -426,18 +426,16 @@
 ance();%0A
-%09%09
 %09Connect
@@ -501,18 +501,16 @@
 SWORD);%0A
-%09%09
 %09return 
@@ -521,19 +521,26 @@
 ection;%0A
-%09%09%7D
+    %7D %0A   
  catch (
@@ -557,18 +557,16 @@
 on e) %7B%0A
-%09%09
 %09e.print
@@ -579,18 +579,20 @@
 race();%0A
-%09%09
+    
 %7D catch 
@@ -607,18 +607,16 @@
 on ex)%7B%0A
-%09%09
 %09System.
@@ -698,14 +698,18 @@
 %22);%0A
-%09%09%7D%0A%09%09
+    %7D%0A    
 retu

Update DB.java