Databases Reference
In-Depth Information
import java.sql.SQLException;
import java.sql.Types;
import org.dbunit.Assertion;
import org.dbunit.database.DatabaseConnection;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.ITable;
import org.dbunit.dataset.SortedTable;
import
org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
import org.dbunit.operation.DatabaseOperation;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class Basistests {
private static Connection con = null;
private static String dbAdresse = "127.0.0.1";
private static String dbInstanz = "XE";
private static IDatabaseConnection connDBU;
private static void verbinden(String nutzer,
String passwort)
throws Exception {
DriverManager.registerDriver(
new oracle.jdbc.driver.OracleDriver());
con = DriverManager
.getConnection("jdbc:oracle:thin:@"
+ dbAdresse
+ ":1521:"
+ dbInstanz, nutzer, passwort);
}
public static void verbindungTrennen()
throws Exception {
if (con != null) {
con.close();
}
}
@BeforeClass
public static void setUpBeforeClass()
throws Exception {
verbinden("ich", "x");
connDBU = new DatabaseConnection(con, null
, true);
314
Search WWH ::




Custom Search