## org.apache.mahout.cf.taste.impl.common.jdbc
Class AbstractJDBCComponent

    java.lang.Object
      org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent

    public abstract class AbstractJDBCComponent

extends Object

A helper class with common elements for several JDBC-related components.

Field Summary
`protected static String` `DEFAULT_DATASOURCE_NAME`

Constructor Summary
`AbstractJDBCComponent()`

Method Summary
`protected static void` `checkNotNullAndLog(String argName, Object value)`
`protected static void` `checkNotNullAndLog(String argName, Object[] values)`
`protected int` `getFetchSize()`
`static DataSource` `lookupDataSource(String dataSourceName)` Looks up a `DataSource` by name from JNDI.

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

Field Detail

### DEFAULT_DATASOURCE_NAME

    protected static final String DEFAULT_DATASOURCE_NAME

See Also:
  Constant Field Values

Constructor Detail

### AbstractJDBCComponent

    public AbstractJDBCComponent()

Method Detail

### checkNotNullAndLog

    protected static void checkNotNullAndLog(String argName,
                                             Object value)

### checkNotNullAndLog

    protected static void checkNotNullAndLog(String argName,
                                             Object[] values)

### lookupDataSource

    public static DataSource lookupDataSource(String dataSourceName)
                                       throws TasteException

  Looks up a `DataSource` by name from JNDI. "java:comp/env/" is prepended to the argument before looking up the name in JNDI.

  Parameters:
    `dataSourceName` - JNDI name where a `DataSource` is bound (e.g. "jdbc/taste")
  Returns:
    `DataSource` under that JNDI name
  Throws:
    `TasteException` - if a JNDI error occurs

### getFetchSize

    protected int getFetchSize()

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.