I've downloaded the SQL Server 2005 file sqljdbc.jar. I've put it into my class path and removed the mssqlserver.jar file that used to be there. I'm connecting with <blockquote>code:<pre name="code" class="core"> DriverManager.getConnection("com.microsoft.jdbc.sqlserver.SQLServerDriver", myusername, mypassword) </pre></blockquote> but I'm getting this error : java.sql.SQLException: No suitable driver Is there some other step I need to take. I haven't set up the driver anywhere.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
That's the driver name for the old SQLServer 2000 driver; see here.
I have included sqljdbc.jar at the top of my classpath and I have removed msbase.jar, msutil.jar and mssqlserver.jar although I also tried this before removing them. I'm using the same url as I did with the 2000 driver. All I need is the jar file right? Once it's on my computer and available in classpath, I don't need to 'execute' it anywhere or set up the driver somehow?
Typos? You should really learn how to copy and paste. Faster and more accurate.
Anyway, yes, the only setup required is to put the jar in your classpath. If it isn't there, then Class.forName will fail and you will get a ClassNotFoundException. Since you aren't getting that, then you are successfully loading the class.
The error message you are getting normally means the JDBC URL isn't understood by any JDBC drivers you have loaded. When you switched to the new SQL Server, did you change the URL to correspond with what it requires?
Paul O'Neill
Ranch Hand
Joined: Mar 13, 2007
Posts: 40
posted
0
As far as I know, yes. I changed the server piece to match the SQL2005 server. I'm still using port 1433. Here it is :
This is exactly what I have working with SQL2000 except for the server name.
Paul O'Neill
Ranch Hand
Joined: Mar 13, 2007
Posts: 40
posted
0
Yes, the problem is with the URL. I need to use jdbc:sqlserver:// instead of jdbc:microsoft:sqlserver://
Unfortunately I'm getting a codepage 850 error now.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.