So, I searched through both the x10hosting forums and around the internet and concluded that SQL databases hosted by x10hosting are compatible with JDBC (Java Database Connectivity). Assuming I am correct in my conclusion, I believe I am running into a problem with either the driver software on the vox server or into a problem with my logic. Below, there is an excerpt from the code I am using in a java applet hosted on my site (this applet is server-sided, which requires a database). Beneath the code excerpt, there is the error message I am experiencing. The error message is a stack-trace from Debug as Applet through Eclipse Juno.
Note: There are no problems with the other parts of the code, I have checked and narrowed it down to just this block of code being problematic.
Is it one of two things:
- I am using the wrong hostname for the database. If so, I need help formatting the hostname into how Vox formats database URLs for use in JDBC
- I am experiencing an issue with the driver (maybe there is no driver on vox which supports JDBC, although this is unlikely)
Code Excerpt (Java):
Can anyone shed some light on this issue? Is JDBC supported by Free Hosting? If not, what level of Paid Hosting would I need in order to get JDBC driver support?
Note: There are no problems with the other parts of the code, I have checked and narrowed it down to just this block of code being problematic.
Is it one of two things:
- I am using the wrong hostname for the database. If so, I need help formatting the hostname into how Vox formats database URLs for use in JDBC
- I am experiencing an issue with the driver (maybe there is no driver on vox which supports JDBC, although this is unlikely)
Code Excerpt (Java):
Code:
[SIZE=2]btnSignIn.addActionListener(
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]new[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] ActionListener(){[/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@Override[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]public[/COLOR][/SIZE][/COLOR][/SIZE][/B][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] actionPerformed(ActionEvent arg0) {[/SIZE]
[SIZE=2]
String user =
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]textField[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();[/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#646464][SIZE=2][COLOR=#646464]@SuppressWarnings[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"deprecation"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]
String strpass =
[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]passwordField[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].getText();[/SIZE]
[SIZE=2]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]try[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {[/SIZE]
[SIZE=2]
Connection con = DriverManager.[I]getConnection[/I](
[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"jdbc:mysql://eternalimperium.x10.mx/ei01_ucp"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"ei01"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"#######"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2]
Statement st = con.createStatement();
String query =
[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"SELECT pass FROM users where account='"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]+user+[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"'"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]
System.
[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]out[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2].println(query);[/SIZE]
[SIZE=2]
ResultSet rs = st.executeQuery(query);
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2](rs.next())[/SIZE]
[SIZE=2]
{
String dbpass = rs.getString(1);
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]if[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2](dbpass.equals(strpass)){[/SIZE]
[SIZE=2]
JOptionPane.[I]showMessageDialog[/I](
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Login Successful! "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Access Granted"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],JOptionPane.[/SIZE][I][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PLAIN_MESSAGE[/COLOR][/SIZE][/COLOR][/SIZE][/I][SIZE=2]);[/SIZE]
[SIZE=2]
}
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/COLOR][/SIZE][/COLOR][/SIZE][/B]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {
JOptionPane.[I]showMessageDialog[/I](
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Incorrect Password."[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Access Denied"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],1);[/SIZE]
[SIZE=2]
}
}
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]else[/COLOR][/SIZE][/COLOR][/SIZE][/B]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] {
JOptionPane.[I]showMessageDialog[/I](
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"User not found."[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Access Denied"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],1);[/SIZE]
[SIZE=2]
}
}
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]catch[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (SQLException ex) {[/SIZE]
[SIZE=2]
JOptionPane.[I]showMessageDialog[/I](
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]null[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"An internal error occured processing your request.\n"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] +[/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"["[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + ex.getErrorCode() + [/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"] "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + ex.getMessage() +[/SIZE]
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]""[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],[/SIZE][SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]"Internal Error"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2],1);[/SIZE]
[SIZE=2]
ex.printStackTrace();
[/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]// Debug Mode ONLY[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] }
}
});
[/SIZE]
Can anyone shed some light on this issue? Is JDBC supported by Free Hosting? If not, what level of Paid Hosting would I need in order to get JDBC driver support?