jdbc - Connecting to a SQL Server 2000 db from Java -


i receiving error did see on site, novice java coder think flubbed implementation of solution.

i getting message "sql server version 8 not supported driver. clientconnectionid:602d619d-c033-41d0-9109-80f56e3ab9b3"

i using eclipse mars 1 database sql server 2000, downloaded sqljdbc.jar microsoft site suggested earlier question. loaded c:\temp , added classpath , rebooted.

code snippet reads:

package texaslampconversion;  import java.sql.*; import java.io.bufferedreader; import java.io.file; import java.io.filereader; import java.io.filewriter; import java.io.ioexception;  public class texaslampconversion {      public static void main(string[] args) {         // todo auto-generated method stub         string host = "jdbc:sqlserver://servername\\instancename";         string uname = "*********";         string upass = "*********";         connection conn = null;          try {              conn  = drivermanager.getconnection(host, uname,upass);              if (conn != null) {                                system.out.println("connected database");               }          } catch (sqlexception ex) {             system.out.println(ex.getmessage() );             ex.printstacktrace();         } {             if (conn != null) {                 try {                     conn.close();                 } catch (sqlexception ex) {                     ex.printstacktrace();                 }             }         }          filewriter fw= null;         file file =null;            try {                 file=new file("c:/temp/generated_stmts_update_t_customer_master.sql");                 if(!file.exists()) {                     file.createnewfile();                 }                 fw = new filewriter(file);            }catch (ioexception e) {                 e.printstacktrace();                 }          string  oldkey = "8000001234", newkey = "8";         int     lenacct = 10;         oldkey = reformatoldacct(lenacct, oldkey );         newkey = leftzeroacct(lenacct, newkey);         system.out.println("oldkey = " + oldkey + " , newkey = " + newkey);      }      private static string reformatoldacct(int lenacct, string oldkey) {         // todo auto-generated method stub         string reformatedacct = "";         reformatedacct = "0" + oldkey.substring(2, lenacct);         return (reformatedacct);      }      private static string leftzeroacct(int lenacct, string acctno) {         // todo auto-generated method stub         int index =0;         int currentlengthacct;         string  leadingzero = "";         currentlengthacct = acctno.length();          while (index < (lenacct -currentlengthacct) ) {             leadingzero = '0'  + leadingzero;             index ++;         }         return (leadingzero + acctno);     }  } 

and throwing complete message

apr 19, 2016 11:29:44 com.microsoft.sqlserver.jdbc.sqlserverconnection prelogin warning: connectionid:1 clientconnectionid: 602d619d-c033-41d0-9109-80f56e3ab9b3 server major version:8 not supported driver. apr 19, 2016 11:29:44 com.microsoft.sqlserver.jdbc.sqlserverconnection prelogin warning: connectionid:1 clientconnectionid: 602d619d-c033-41d0-9109-80f56e3ab9b3 server major version:8 not supported driver. com.microsoft.sqlserver.jdbc.sqlserverexception: sql server version 8 not supported driver. clientconnectionid:602d619d-c033-41d0-9109-80f56e3ab9b3com.microsoft.sqlserver.jdbc.sqlserverexception: sql server version 8 not supported driver. clientconnectionid:602d619d-c033-41d0-9109-80f56e3ab9b3

at com.microsoft.sqlserver.jdbc.sqlserverconnection.terminate(sqlserverconnection.java:2226)    @ com.microsoft.sqlserver.jdbc.sqlserverconnection.terminate(sqlserverconnection.java:2226) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.terminate(sqlserverconnection.java:2210) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.terminate(sqlserverconnection.java:2210) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.prelogin(sqlserverconnection.java:2095)  @ com.microsoft.sqlserver.jdbc.sqlserverconnection.prelogin(sqlserverconnection.java:2095) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.connecthelper(sqlserverconnection.java:1799) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.connecthelper(sqlserverconnection.java:1799) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.login(sqlserverconnection.java:1454) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.login(sqlserverconnection.java:1454) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.connectinternal(sqlserverconnection.java:1285) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.connectinternal(sqlserverconnection.java:1285) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.connect(sqlserverconnection.java:700) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.connect(sqlserverconnection.java:700) @ com.microsoft.sqlserver.jdbc.sqlserverdriver.connect(sqlserverdriver.java:1131) @ com.microsoft.sqlserver.jdbc.sqlserverdriver.connect(sqlserverdriver.java:1131) @ java.sql.drivermanager.getconnection(unknown source) @ java.sql.drivermanager.getconnection(unknown source) @ java.sql.drivermanager.getconnection(unknown source) @ java.sql.drivermanager.getconnection(unknown source) @ texaslampconversion.texaslampconversion.main(texaslampconversion.java:20) @ texaslampconversion.texaslampconversion.main(texaslampconversion.java:20) 

sql server version 8 not supported driver. clientconnectionid:602d619d-c033-41d0-9109-80f56e3ab9b3 sql server version 8 not supported driver. clientconnectionid:602d619d-c033-41d0-9109-80f56e3ab9b3

any thoughts novice java programmer moving away powerbuilder?


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -