JdbcDataSource (Solr 3.6.2 API)
Keywords: org.apache.solr.handler.dataimport.JdbcDataSource class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.handler.dataimport
Class JdbcDataSource

    java.lang.Object
      org.apache.solr.handler.dataimport.DataSource<Iterator<Map<String,Object>>>
          org.apache.solr.handler.dataimport.JdbcDataSource

    public class JdbcDataSource

extends DataSource<Iterator<Map<String,Object>>>

A DataSource implementation which can fetch data using JDBC.

Refer to http://wiki.apache.org/solr/DataImportHandler for more details.

This API is experimental and may change in the future.

Since:
  solr 1.3
Version:
  $Id: JdbcDataSource.java 1065312 2011-01-30 16:08:25Z rmuir $

Field Summary
`static String` | `CONVERT_TYPE`
`static String` | `DRIVER`
`protected Callable<Connection>` | `factory`
`static String` | `JNDI_NAME`
`static String` | `URL`

Constructor Summary
`JdbcDataSource()`

Method Summary
`void` | `close()` Cleans up resources of this DataSource after use.
`protected Callable<Connection>` | `createConnectionFactory(Context context, Properties initProps)`
`protected void` | `finalize()`
`Iterator<Map<String,Object>>` | `getData(String query)` Get records for the given query.The return type depends on the implementation .
`void` | `init(Context context, Properties initProps)` Initializes the DataSource with the `Context` and initialization properties.

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### factory

    protected Callable<Connection> factory

### URL

    public static final String URL

See Also:
  Constant Field Values

### JNDI_NAME

    public static final String JNDI_NAME

See Also:
  Constant Field Values

### DRIVER

    public static final String DRIVER

See Also:
  Constant Field Values

### CONVERT_TYPE

    public static final String CONVERT_TYPE

See Also:
  Constant Field Values

Constructor Detail

### JdbcDataSource

    public JdbcDataSource()

Method Detail

### init

    public void init(Context context,
                     Properties initProps)

  Description copied from class: `DataSource`
  Initializes the DataSource with the `Context` and initialization properties.

  This is invoked by the `DataImporter` after creating an instance of this class.

  Specified by:
    `init` in class `DataSource<Iterator<Map<String,Object>>>`

### createConnectionFactory

    protected Callable<Connection> createConnectionFactory(Context context,
                                                           Properties initProps)

### getData

    public Iterator<Map<String,Object>> getData(String query)

  Description copied from class: `DataSource`
  Get records for the given query.The return type depends on the implementation .

  Specified by:
    `getData` in class `DataSource<Iterator<Map<String,Object>>>`
  Parameters:
    `query` - The query string. It can be a SQL for JdbcDataSource or a URL for HttpDataSource or a file location for FileDataSource or a custom format for your own custom DataSource.
  Returns:
    Depends on the implementation. For instance JdbcDataSource returns an Iterator >

### finalize

    protected void finalize()
                     throws Throwable

  Overrides:
    `finalize` in class `Object`
  Throws:
    `Throwable`

### close

    public void close()

  Description copied from class: `DataSource`
  Cleans up resources of this DataSource after use.

  Specified by:
    `close` in class `DataSource<Iterator<Map<String,Object>>>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD