org.jdiagnose.library
Class BasicJdbcDiagnostic

java.lang.Object
  extended byorg.jdiagnose.DiagnosticUnit
      extended byorg.jdiagnose.library.BasicJdbcDiagnostic
All Implemented Interfaces:
Diagnostic, DiagnosticContainer, DiagnosticUnitLifeCycle

public class BasicJdbcDiagnostic
extends DiagnosticUnit

Tests a JDBC connection using driver, url, username, password and test sql settings. See the JDiagnose-Library project for other Database Diagnostics.

Author:
jamie

Constructor Summary
BasicJdbcDiagnostic()
          Default Constructor.
BasicJdbcDiagnostic(java.lang.String name)
           
BasicJdbcDiagnostic(java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String sql)
          Full constructor.
BasicJdbcDiagnostic(java.lang.String name, java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password, java.lang.String sql)
          Full constructor.
 
Method Summary
 void diagnoseSql()
          Try to connect to the JDBC url using the driver, username and password settings.
 java.lang.String getDriver()
           
 java.lang.String getPassword()
           
 java.lang.String getSql()
           
 java.lang.String getUrl()
           
 java.lang.String getUsername()
           
 void setDriver(java.lang.String driver)
           
 void setPassword(java.lang.String password)
           
 void setSql(java.lang.String sql)
           
 void setUrl(java.lang.String url)
           
 void setUsername(java.lang.String username)
           
 
Methods inherited from class org.jdiagnose.DiagnosticUnit
assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertTrue, assertTrue, diagnose, getDiagnosticContainers, getDiagnostics, getName, setUp, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicJdbcDiagnostic

public BasicJdbcDiagnostic(java.lang.String name,
                           java.lang.String driver,
                           java.lang.String url,
                           java.lang.String username,
                           java.lang.String password,
                           java.lang.String sql)
Full constructor.

Parameters:
name - the name of this diagnostic
driver - jdbc driver to use
url - jdbc url
username - jdbc username
password - jdbc password
sql - sql to use to test the connection

BasicJdbcDiagnostic

public BasicJdbcDiagnostic(java.lang.String driver,
                           java.lang.String url,
                           java.lang.String username,
                           java.lang.String password,
                           java.lang.String sql)
Full constructor.

Parameters:
driver -
url -
username -
password -
sql -

BasicJdbcDiagnostic

public BasicJdbcDiagnostic()
Default Constructor. The driver, url, username, password and sql properties must be set.


BasicJdbcDiagnostic

public BasicJdbcDiagnostic(java.lang.String name)
Method Detail

diagnoseSql

public void diagnoseSql()
                 throws java.sql.SQLException,
                        java.lang.ClassNotFoundException
Try to connect to the JDBC url using the driver, username and password settings.

Throws:
java.sql.SQLException
java.lang.ClassNotFoundException

getDriver

public java.lang.String getDriver()
Returns:
Returns the driver.

setDriver

public void setDriver(java.lang.String driver)
Parameters:
driver - The driver to set.

getPassword

public java.lang.String getPassword()
Returns:
Returns the password.

setPassword

public void setPassword(java.lang.String password)
Parameters:
password - The password to set.

getSql

public java.lang.String getSql()
Returns:
Returns the sql.

setSql

public void setSql(java.lang.String sql)
Parameters:
sql - The sql to set.

getUrl

public java.lang.String getUrl()
Returns:
Returns the url.

setUrl

public void setUrl(java.lang.String url)
Parameters:
url - The url to set.

getUsername

public java.lang.String getUsername()
Returns:
Returns the username.

setUsername

public void setUsername(java.lang.String username)
Parameters:
username - The username to set.


Copyright © 2004-2005 Grape Design Limited. All Rights Reserved.