import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBConnect {
public static void main(String[] args) {
String host = ("jdbc:derby://localhost:1527/Employees");
String uName = ("sa");
String uPass = ("saa");
try {
Connection con = DriverManager.getConnection(host, uName, uPass);
}
catch ( SQLException err) {
System.out.println( err.getMessage());
}
}
}
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - exception java.sql.SQLException is never th [missing fragment here]
The code looks fine except that you misspelled DriverManager
as DriveManager
. (Notice the missing 'r')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.