Reputation: 3
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]
Upvotes: 0
Views: 40
Reputation: 393
The code looks fine except that you misspelled DriverManager
as DriveManager
. (Notice the missing 'r')
Upvotes: 1