-
Java applet connection error [MySQL DB]
Hello,
I'm stuck with the same problem the last few days. I'm creating an applet in which you have to log in before you are able to see your account details. I tried this in an application and it worked fine. I dont see the difference, can some of you guys help me ? Here is the code i used:
I'm doing all of this at my localhost server, port 3306 (as far is i know its default), and my users_db database
static String DBURL = "jdbc:mysql://localhost:3306/users_db?user=****&password=********";
try {
try {
try {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
}
} catch (Exception ex) {
}
}
catch (Exception ex) {
}
Connection con = DriverManager.getConnection(DBURL);
System.out.println("Succesfully connected!");
Label ok = new Label("Connected");
add(ok);
}
catch(SQLException e) {
Label not = new Label("Not connected:"+e.getMessage());
add(not);
}
Greetz,
Kprojects
-
-
Why do you have one-time variables, why are you using AWT rather than Swing, and what exactly is the error?
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks