Ich kann keine Verbindung zu MySQL DB herstellen. TRAVERMANAGER -Fehler. Java + NetBeans

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Ich kann keine Verbindung zu MySQL DB herstellen. TRAVERMANAGER -Fehler. Java + NetBeans

by Guest » 07 Feb 2025, 00:43

Keine Ahnung, was ich falsch mache, warum TriverManager in Rot unterstrichen ist, und Netbeans schlägt vor, eine DriverManager -Klasse zu erstellen ... < /p>

Code: Select all

public class regularcustomerreg extends javax.swing.JFrame {

/**
* Creates new form regularcustomerreg
*/
public regularcustomerreg() {
initComponents();
}

Connection con;
PreparedStatement pst;

public void Connect() {

try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/lutonhotel", "root", "");

} catch (ClassNotFoundException ex) {
Logger.getLogger(regularcustomerreg.class.getName()).log(Level.SEVERE, null, ex);
}

}

Top