net.sourceforge.mavenplugins.dbunit
Class DbUnitTool
java.lang.Object
net.sourceforge.mavenplugins.dbunit.DbUnitTool
- Direct Known Subclasses:
- DataSetConverter, DataSetTool, DTDGenerator
public class DbUnitTool
- extends java.lang.Object
Base class for working with DbUnit
- Author:
- Dion Gillard
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DbUnitTool
public DbUnitTool()
getDriverClassName
public java.lang.String getDriverClassName()
setDriverClassName
public void setDriverClassName(java.lang.String name)
getUrl
public java.lang.String getUrl()
setUrl
public void setUrl(java.lang.String newURL)
getUser
public java.lang.String getUser()
setUser
public void setUser(java.lang.String newUser)
getPassword
public java.lang.String getPassword()
setPassword
public void setPassword(java.lang.String newPassword)
getFileName
public java.lang.String getFileName()
setFileName
public void setFileName(java.lang.String newFileName)
getSchema
public java.lang.String getSchema()
setSchema
public void setSchema(java.lang.String schema)
getConnection
protected org.dbunit.database.IDatabaseConnection getConnection()
throws java.sql.SQLException,
java.lang.ClassNotFoundException
- Returns:
- a database connection from the url, user and password
- Throws:
java.sql.SQLException
- if some other jdbc error happens
java.lang.ClassNotFoundException
- if the jdbc driver can't be found
getDataSetFromFile
protected org.dbunit.dataset.IDataSet getDataSetFromFile(java.lang.String fileName,
java.lang.String format)
throws org.dbunit.dataset.DataSetException,
java.io.IOException
- Parameters:
fileName
- the name of the fileformat
- the dbunit format, e.g. excel, xml, flat etc
- Returns:
- a dataset from the file of the given format
- Throws:
org.dbunit.dataset.DataSetException
java.io.IOException
writeDataSetToFile
protected void writeDataSetToFile(java.lang.String fileName,
java.lang.String format,
org.dbunit.dataset.IDataSet dataset)
throws org.dbunit.dataset.DataSetException,
java.io.FileNotFoundException,
java.io.IOException
- Write the dataset to the file in that format.
- Parameters:
fileName
- the name of the fileformat
- the dbunit format, e.g. excel, xml, flat etcthe
- data set to write
- Throws:
org.dbunit.dataset.DataSetException
java.io.FileNotFoundException
java.io.IOException
Copyright © 2003-2009 SourceForge. All Rights Reserved.