char[] aPPw = pfApw.getPassword();
String aPw = new String(aPPw);
String user = tfAdmin.getText();
boolean uready = false;
boolean pwready = false;
Connection connection = null;
// Hash hash = new Hash("MD5");
// System.out.println(hash.do_checksum(aPw));
try {
// Load the JDBC driver
String driverName = "org.gjt.mm.mysql.Driver"; // MySQL MM JDBC driver
Class.forName(driverName);
// Create a connection to the database
String serverName = "mysql.lima-city.de";
String mydatabase = "db_24282_9";
String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url
String username = "USER24282";
String password = "******";
connection = DriverManager.getConnection(url, username, password);
// Hierher soll der Teil wo überprüft werden soll, ob die Zugangsdaten stimmen!!!!
} catch (ClassNotFoundException e) {
// Could not find the database driver
} catch (SQLException e) {
// Could not connect to the database
}
connection connection = null;
//Hash hash = new Hash("MD5");
//System.out.println(hash.do_checksum(aPw));
try {
// Load the JDBC driver
String driverName = "com.mysql.jdbc.Driver"; // MySQL MM JDBC driver
Class.forName(driverName);
// Create a connection to the database
String serverName = "mysql.lima-city.de";
String mydatabase = "db_24282_9";
String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url
String username = "USER24282";
String password = "******";
connection = DriverManager.getConnection(url, username, password);
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery( "SELECT * FROM user where user = "+user);
String pw = rs.getString("passwrd");
if(aPw.equals(pw))
{
System.out.println("Alles richtig eingegeben!");
ACP acp = new ACP();
this.setVisible(false);
acp.setVisible(true);
}
else
{
JOptionPane.showMessageDialog(this, "Der eingegebene Username oder das Passwort sind ungültig!!", "Fehler", JOptionPane.ERROR_MESSAGE);
System.out.println("Alles falsch eingegeben!");
}
} catch (ClassNotFoundException e) {
System.out.println("fehler1");
// Could not find the database driver
} catch (SQLException e) {
System.out.println("fehler2");// Could not connect to the database
}
spitzenlogik! weil der osterhase weiß wo er die eier versteckt hat weiß es das kind dass die dinger sucht natürlich auch ...weirer hat gesagt.:Also hab ich die ganzen packages gefunden aber irgendwie hat das ganze niht ganz gefuzt!
alex0801 hat gesagt.:Also, schreib für den absolut letzten Voll-Noob auf, W I E du den Treiber in den Classpath aufgenommen hast. Gerne auch mit Screenshots.