xsmeral.semnet.crawler
Class RDBLayer
java.lang.Object
xsmeral.semnet.crawler.RDBLayer
public class RDBLayer
- extends Object
Relational DB Layer for Crawler.
RDBLayer
public RDBLayer(Properties dbProps)
throws ConfigurationException
- Constructs the DB layer with parameters specified in the given Properties instance.
The parameters are:
- driver - full name of the JDBC driver class
- url - JDBC URL of the DB
- user
- password
- schema - the schema to use for all operations
- autoCommit - (optional) indicates, whether all operations should be automatically commited
- Throws:
ConfigurationException
RDBLayer
public RDBLayer(String dbDriverClassName,
String dbURL,
String dbUser,
String dbPassword,
String dbSchema,
boolean autoCommit)
throws ConfigurationException
- Throws:
ConfigurationException
isAutoCommit
public boolean isAutoCommit()
getDriver
public Class getDriver()
getPassword
public String getPassword()
getURL
public String getURL()
getUser
public String getUser()
getSchema
public String getSchema()
getConnection
public Connection getConnection()
throws SQLException
- Returns a new connection to the database.
After getting a connection, the caller is responsible to close it as well.
This class doesn't take care of the connections after creation.
- Returns:
- A new connection
- Throws:
SQLException
- If the driver manager fails to return a connection
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object