[ 
https://issues.apache.org/jira/browse/SOLR-9018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15250171#comment-15250171
 ] 

Kevin Risden commented on SOLR-9018:
------------------------------------

Jython zxJDBC example script:
{code}
#!/usr/bin/env jython

# http://www.jython.org/jythonbook/en/1.0/DatabasesAndJython.html
# https://wiki.python.org/jython/DatabaseExamples#SQLite_using_ziclix

import sys

from com.ziclix.python.sql import zxJDBC

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"

  with zxJDBC.connect(jdbc_url, None, None, driverName) as conn:
    with conn:
      with conn.cursor() as c:
        c.execute(statement)
        print(c.fetchall())

  sys.exit(0)
{code}

> SolrJ JDBC - Jython Documentation
> ---------------------------------
>
>                 Key: SOLR-9018
>                 URL: https://issues.apache.org/jira/browse/SOLR-9018
>             Project: Solr
>          Issue Type: Sub-task
>          Components: SolrJ
>            Reporter: Kevin Risden
>
> Jython integrates both Python and Java. This makes connecting to JDBC 
> possible. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to