Hey guys, I've been using these forums as a great reference for awhile and now I'm stumped and in need of a hand.
So I'm writing a web app and need to connect to a SQL Server db, here is what I've created from the Java side of things:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Class found");
String accessDBURLPrefix = "jdbc:odbc:sqlserver://142.225.235.83;Initial Catalog=event;Persist Security Info=True;User ID=******";
Connection con = DriverManager.getConnection(accessDBURLPrefix);
System.out.println("Database Found");
Statement s = con.createStatement();
//String query = "SELECT * FROM [SITE SETUP]";
ResultSet rs = s.executeQuery(query);
I'm getting the error:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Now I can open the db no problem in the VS 2005 connection manager and the connection string it lists in the properties is:
Data Source=142.174.35.83;Initial Catalog=event;Persist Security Info=True;User ID=*******
I guess even after looking up all the connection string examples online I still can't get it right.
Any hints?
Message was edited by:
Piers