File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Sql query in data-config.xml (Solr Apache) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Sql query in data-config.xml (Solr Apache)" Watch "Sql query in data-config.xml (Solr Apache)" New topic

Sql query in data-config.xml (Solr Apache)

kavi gam

Joined: Sep 27, 2011
Posts: 6
Can anybody help with this issue?

In my data-config.xml i have the following sql queries.

<entity dataSource="mtls-ds" name="t" query="select * from tp where tp_id > 220754 and tp_id < 220900" pk="tp_id">
<entity dataSource="mtls-ds" name="tProd" query="select * from prod tp where tp.catlg_core_id='${t.CATLG_CORE_ID}' and tp.catlg_pfix_id='${(t.CATLG_PFIX_ID)}'">

But when i try to execute , t.CATLG_PFIX_ID value is coming as INT'L and its throwing the below error.

select * from prod tp where tp.catlg_core_id='REL' and tp.catlg
_pfix_id=' INT'L' Processing Document # 208136
at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(
at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(
at org.apache.solr.handler.dataimport.JdbcDataSource.getData(
at org.apache.solr.handler.dataimport.JdbcDataSource.getData(
at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(
at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(
at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(
at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(
at org.apache.solr.handler.dataimport.DocBuilder.execute(
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(
at org.apache.solr.handler.dataimport.DataImporter.runCmd(
at org.apache.solr.handler.dataimport.DataImporter$
Caused by: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

at oracle.jdbc.driver.SQLStateMapping.newSQLException(
at oracle.jdbc.driver.DatabaseError.newSQLException(
at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.T4CTTIoer.processError(
at oracle.jdbc.driver.T4CTTIoer.processError(
at oracle.jdbc.driver.T4C8Oall.receive(
at oracle.jdbc.driver.T4CStatement.doOall8(
at oracle.jdbc.driver.T4CStatement.executeForDescribe(
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
at oracle.jdbc.driver.OracleStatement.executeInternal(
at oracle.jdbc.driver.OracleStatement.execute(
at oracle.jdbc.driver.OracleStatementWrapper.execute(
at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(
... 12 more

Thanks in advance.
I agree. Here's the link:
subject: Sql query in data-config.xml (Solr Apache)
Similar Threads
DBUnit ...looading data to database getting error of integrity constraint
Error while executing query through JDBC
java.sql.SQLException: Protocol violation
query working in sqldeveloper and not from java jdbc
JDBC Connection