Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How do I connect to local SQL database using java jdbc
- try{
- Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
- DriverManager.getConnection("jdbc:sqlserver://localhost:1433");
- }catch(Exception e){
- System.out.println("Couldn't get database connection.");
- e.printStackTrace();
- }
- Couldn't get database connection.
- Oct 06, 2012 11:15:37 PM com.microsoft.sqlserver.jdbc.SQLServerConnection <init>
- DRIVER CLASS: com.microsoft.sqlserver.jdbc.SQLServerDriver
- JDBC URL FORMAT: jdbc:sqlserver://<server_name>:<port>
- jdbc:sqlserver://neptune.acme.com:1433
- jdbc:sqlserver://127.0.0.1:1433
Add Comment
Please, Sign In to add comment