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

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
Direct Known Subclasses:
AbstractJDBCDataModel, AbstractJDBCDiffStorage, AbstractJDBCItemSimilarity

public abstract class AbstractJDBCComponent
extends java.lang.Object

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


Field Summary
protected static java.lang.String DEFAULT_DATASOURCE_NAME
           
 
Constructor Summary
AbstractJDBCComponent()
           
 
Method Summary
protected  void advanceResultSet(java.sql.ResultSet resultSet, int n)
           
protected static void checkNotNullAndLog(java.lang.String argName, java.lang.Object value)
           
protected static void checkNotNullAndLog(java.lang.String argName, java.lang.Object[] values)
           
protected  int getFetchSize()
           
static javax.sql.DataSource lookupDataSource(java.lang.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 java.lang.String DEFAULT_DATASOURCE_NAME
See Also:
Constant Field Values
Constructor Detail

AbstractJDBCComponent

public AbstractJDBCComponent()
Method Detail

checkNotNullAndLog

protected static void checkNotNullAndLog(java.lang.String argName,
                                         java.lang.Object value)

checkNotNullAndLog

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

lookupDataSource

public static javax.sql.DataSource lookupDataSource(java.lang.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()

advanceResultSet

protected void advanceResultSet(java.sql.ResultSet resultSet,
                                int n)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.