I’m writing an application that searches by solr 3.4. To fill the index of solr I use the dataimporthandler and the com.microsoft.sqlserver.jdbc.SQLServerDriver class to get
You need to call stored procedure using following syntax
<entity name="PicturePath" processor="CachedSqlEntityProcessor" query="[h_getThumbnails] '4'"
"> </entity>
For me it works like this:
<dataSource name="ds-1" type="JdbcDataSource" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://10.0.2.47;databaseName=dbname" user="username" password="password"
responseBuffering="adaptive" batchSize="0" autoCommit="false" />
<entity name="item" dataSource="ds-1" query="[sp_StuffDataImportHandler]"></entity>
But this only works if the stored procedure contains a simple SELECT query.
If I declare some variables or temporrary tables before the query that will return the results then the import fails, giving me the same exception that you get.
LATER EDIT
I managed to make it work with more complex queries in the Stored Procedure. by adding
SET NOCOUNT ON;
at the beginning of the stored procedure.