I'm new to Java
network side. For some reason my java
file cannot connect to the localhost
database. I keep on receiving an error. Please help
test.java:
import java.sql.*;
class test {
public static void main(String[] args) {
try {
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/user", "root", "");
} catch(Exception exp) {
exp.printStackTrace();
}
}
}
error:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost/user
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at test.main(test.java:7)
directory: