You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Uwe Schindler (JIRA)" <ji...@apache.org> on 2015/09/10 19:27:45 UTC

[jira] [Comment Edited] (SOLR-7986) JDBC Driver for SQL Interface

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

Uwe Schindler edited comment on SOLR-7986 at 9/10/15 5:26 PM:
--------------------------------------------------------------

For a full compliant JDBC driver you should also add a META-INF resource, so it can be loaded by DriverManager without doing the forName() on the base class. By that you can call the driver without any initialization on the Solr-specific driver, just by providing the URL to DriverManager.


was (Author: thetaphi):
For a full compliant JDBC driver you should also add a META-INF resource, so it can be loaded by DriverManager without doing the forName() on the base class. By that you can call the driver without any initialization on the Solr-specific driver.

> JDBC Driver for SQL Interface
> -----------------------------
>
>                 Key: SOLR-7986
>                 URL: https://issues.apache.org/jira/browse/SOLR-7986
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - java
>    Affects Versions: Trunk
>            Reporter: Joel Bernstein
>         Attachments: SOLR-7986.patch, SOLR-7986.patch, SOLR-7986.patch, SOLR-7986.patch
>
>
> This ticket is to create a JDBC Driver (thin client) for the new SQL interface (SOLR-7560). As part of this ticket a driver will be added to the Solrj libary under the package: *org.apache.solr.client.solrj.io.sql*
> Initial implementation will include basic *Driver*, *Connection*, *Statement* and *ResultSet* implementations.
> Future releases can build on this implementation to support a wide range of JDBC clients and tools.
> *Syntax using parallel Map/Reduce for aggregations*:
> {code}
> Properties props = new Properties();
> props.put("aggregatioMode", "map_reduce");
> props.put("numWorkers", "10");
> Class.forName("org.apache.solr.client.solrj.io.sql.DriverImpl").newInstance();
> Connection con = DriverManager.getConnection("jdbc:solr:<zkhost:port>?collection=<collection>", props);
> Statement stmt = con.createStatement();
> ResultSet rs = stmt.executeQuery("select ....");
> while(rs.next()) {
> }
> {code} 
> *Syntax using JSON facet API for aggregations*:
> {code}
> Properties props = new Properties();
> props.put("aggregationMode", "facet");
> Class.forName("org.apache.solr.client.solrj.io.sql.DriverImpl").newInstance();
> Connection con = DriverManager.getConnection("jdbc:solr:<zkhost:port>?collection=<collection>", props);
> Statement stmt = con.createStatement();
> ResultSet rs = stmt.executeQuery("select ....");
> while(rs.next()) {
> }
> {code}
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org