Package helma.scripting.rhino.extensions

# Class DatabaseObject

java.lang.Object
helma.scripting.rhino.extensions.DatabaseObject

public class DatabaseObject extends Object
A Database object, representing a connection to a JDBC Driver

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`DatabaseObject.RowSet`
A RowSet object

## Constructor Summary

Constructors
Constructor
Description
`DatabaseObject(DbSource dbsource)`
Create a new database object based on a hop data source.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`connect(String url, String userName, String password)`
Connect to the database, using the specific url, optional user name and password
`boolean`
`disconnect()`
Disconnect from the database, nop if not conected
`int`
`executeCommand(String sql)`
`DatabaseObject.RowSet`
`executePreparedRetrieval(PreparedStatement statement)`
`DatabaseObject.RowSet`
`executeRetrieval(String sql)`
`String`
`getClassName()`
`Object`
`getLastError()`
`Object`
`getMetaData()`
`void`
`release()`
`String`
`toDetailString()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### DatabaseObject

public DatabaseObject(DbSource dbsource)
Create a new database object based on a hop data source.

Parameters:
  `dbsource` - The name of the DB source

## Method Details

### getClassName

public String getClassName()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### toDetailString

public String toDetailString()

### getLastError

public Object getLastError()

### connect

public boolean connect(String url, String userName, String password)
Connect to the database, using the specific url, optional user name and password

Parameters:
  `url` - the database URL
  `userName` - the database user name
  `password` - the database password
Returns:
  true if successful, false otherwise

### disconnect

public boolean disconnect()
Disconnect from the database, nop if not conected

Returns:
  true if successful, false if error during idsconnect

### release

public void release()

### executeRetrieval

public DatabaseObject.RowSet executeRetrieval(String sql)

### executePreparedRetrieval

public DatabaseObject.RowSet executePreparedRetrieval(PreparedStatement statement)

### executeCommand

public int executeCommand(String sql)

### getMetaData

public Object getMetaData()