File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBCRealm in Tomcat5.5 and SQLServer2005

 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Tomcat 5.5. Having trouble using JDBCRealm with SQLServer2005. Worked with SQLServer 2000. Now Tomcat will not start. Gives a NullPointerException and the following error, "at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:700)".

Realm tag looks like this.

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0" driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
connectionURL="jdbc:microsoft:sqlserver://xxxx;SelectMethod=cursor;databaseName=common" connectionName="common"
connectionPassword="xxxxxx" userTable="STUFF" userNameCol="USERID" userCredCol="PW"
userRoleTable="STUFF_RULES" roleNameCol="role_name"/>

Any help would be appreciated. Thanks.
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't recall what the correct driver URLs are for either of those two databases, but I'm pretty sure they aren't the same. Did you change the driver URL to the correct URL for SQL Server 2005?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also - which driver are you using? The old (discontinued) MS SQL 2000 driver is unlikely to work with 2005. Make sure you are using the new newer driver (or swap to jTDS).
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Clapham:
I don't recall what the correct driver URLs are for either of those two databases, but I'm pretty sure they aren't the same. Did you change the driver URL to the correct URL for SQL Server 2005?


Sorry. I'm still new at this. Are you referring to the driver class name because I did switch that. I changed the connection url to point from the 2000 database to the 2005.
Thanks.
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Sturrock:
Also - which driver are you using? The old (discontinued) MS SQL 2000 driver is unlikely to work with 2005. Make sure you are using the new newer driver (or swap to jTDS).



Sorry. Still new at this. I'm using the sqljdbc.jar file. I believe this is for SQLServer 2005.

Thanks.
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently using version 1_1 of the driver. Tried using 1_2 with no luck.
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Crowson:
I changed the connection url to point from the 2000 database to the 2005.
Thanks.
And did you change to the "jdbc:microsoft:sqlserver" part of the URL from something else, or did you just leave it the way it was for 2000? Leaving it the way it was would have been wrong.
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example of what I currently have.

connectionURL="jdbc:microsoft:sqlserver://99.99.99.999:9999;
integratedSecurity=false;DatabaseName=Promotions"

I didn't change the "jdbc:microsoft:sqlserver://" part, but I did change the number.

Thanks for your help.
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the "jdbc:microsoft:sqlserver://" part supposed to change when connecting to SQLServer 2005? Any other suggestions?

Thanks.
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's supposed to change. After I changed to SQL Server 2005 I stopped using the Microsoft driver (it had an SSL bug that I couldn't work around) and switched to the JTDS driver. So I don't have a working example of it here any more. I was hoping you would look in your documentation.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the s005 JDBC driver documentation. The URL appears to need to be of the for:

jdbc:sqlserver://[serverName[\instanceName][:portNumber]][;property=value[;property=value]]

I'd read through these docs and check what you've done.
[ June 24, 2008: Message edited by: Paul Sturrock ]
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Thanks guys. I think the fact that I have the word microsoft in the connectionURL is part of what is throwing me off.

Thanks again.
 
Joe Crowson
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was it!!! The correct syntax is "jdbc:sqlserver://99.99.99.999:9999;blah;blah;blah".
Thanks again for all your help.
Joe
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic