[
https://issues.apache.org/jira/browse/SOLR-9013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250150#comment-15250150
]
Kevin Risden commented on SOLR-9013:
------------------------------------
The CLASSPATH variable needs to be set to the SolrJ jars before running a
Python script. An example of a Python JayDeBeApi script is below:
{code}
#!/usr/bin/env python
# https://pypi.python.org/pypi/JayDeBeApi/
import jaydebeapi
import sys
if __name__ == '__main__':
jdbc_url = "jdbc:solr://solr:9983?collection=test"
driverName = "org.apache.solr.client.solrj.io.sql.DriverImpl"
statement = "select fielda, fieldb, fieldc, fieldd_s, fielde_i from test
limit 10"
conn = jaydebeapi.connect(driverName, jdbc_url)
curs = conn.cursor()
curs.execute(statement)
print(curs.fetchall())
conn.close()
sys.exit(0)
{code}
> SolrJ JDBC - Python JayDeBeApi documentation
> --------------------------------------------
>
> Key: SOLR-9013
> URL: https://issues.apache.org/jira/browse/SOLR-9013
> Project: Solr
> Issue Type: Sub-task
> Components: SolrJ
> Affects Versions: master, 6.0
> Reporter: Kevin Risden
>
> Like SOLR-8521, it would be great to document how Python JayDeBeApi can be
> used with SolrJ JDBC.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]