removed the instance parameter and it worked fine
Java JTDS to SQL server 2000
Frage
ive got a method that connects to sql server using JTDS
String url = "jdbc:jtds:sqlserver://192.168.12.123;instance=server-e61t7rvb;DatabaseName=test";
String driver = "net.sourceforge.jtds.jdbc.Driver";
String userName = "sa";
String password = "hello";
Class.forName(driver);
conn = DriverManager.getConnection(url, userName, password);
System.out.println("Connected to the database!!! Getting table list...");
DatabaseMetaData dbm = conn.getMetaData();
rs = dbm.getTables(null, null, "%", new String[] { "TABLE" });
while (rs.next()) System.out.println(rs.getString("TABLE_NAME"));
using this i can connect fine to SQL 2008 but when i change it to a SQL 2000 server i get "server has no instance named " for the instance name i am running
select @@servername
note that i can use the instance name to log into the server from my computer using sql management studio.
any help much appreciated
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow