views:

219

answers:

2

Hi

I have a MS SQL database running (MS SQL 2005) and am connecting to it via the net.sourceforge.jtds.jdbc.Driver.

The query works fine for all the columns except one that is a varchar(max). Any ideas how to get around this issues?

I am using the jdbc driver to run a data index into a SOLR implementation.

(I do not control the database, so the first prize solution would be where I can tweak the SQL command to get the desired results)

Thanks

+1  A: 

I have found what looks to be a answer. In setting up the driver for the connection to SQL server I did not specify useLobs=false. I am a bit worried about what this will mean for performance, but at least for now it works.

<dataSource
    driver="net.sourceforge.jtds.jdbc.Driver"
        url="jdbc:jtds:sqlserver://server/database;useLOBs=false" 
    user="user" 
    password="password" />
Rihan Meij
JDBC driver settings always seem very random to me, great simple example!
Eric Pugh
A: 

I had the same problem with connecting to MS SQL 2K3. The useLOBs=false did not work for me, but changing the SELECT to CAST(Name AS varchar(255))'Name' worked for me.

Russell H