mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
pgjindent jdbc files. First time jdbc files were formatted.
This commit is contained in:
@ -6,56 +6,65 @@ import java.sql.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* $Id: JBuilderTest.java,v 1.3 2001/09/23 04:11:14 momjian Exp $
|
||||
* $Id: JBuilderTest.java,v 1.4 2001/10/25 05:59:59 momjian Exp $
|
||||
*
|
||||
* Some simple tests to check that the required components needed for JBuilder
|
||||
* stay working
|
||||
*
|
||||
*/
|
||||
public class JBuilderTest extends TestCase {
|
||||
public class JBuilderTest extends TestCase
|
||||
{
|
||||
|
||||
public JBuilderTest(String name) {
|
||||
super(name);
|
||||
}
|
||||
public JBuilderTest(String name)
|
||||
{
|
||||
super(name);
|
||||
}
|
||||
|
||||
// Set up the fixture for this testcase: the tables for this test.
|
||||
protected void setUp() throws Exception {
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
// Set up the fixture for this testcase: the tables for this test.
|
||||
protected void setUp() throws Exception
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
|
||||
JDBC2Tests.createTable( con, "test_c",
|
||||
"source text,cost money,imageid int4" );
|
||||
JDBC2Tests.createTable( con, "test_c",
|
||||
"source text,cost money,imageid int4" );
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
}
|
||||
JDBC2Tests.closeDB(con);
|
||||
}
|
||||
|
||||
// Tear down the fixture for this test case.
|
||||
protected void tearDown() throws Exception {
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
JDBC2Tests.dropTable(con, "test_c");
|
||||
JDBC2Tests.closeDB(con);
|
||||
}
|
||||
// Tear down the fixture for this test case.
|
||||
protected void tearDown() throws Exception
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
JDBC2Tests.dropTable(con, "test_c");
|
||||
JDBC2Tests.closeDB(con);
|
||||
}
|
||||
|
||||
/**
|
||||
* This tests that Money types work. JDBCExplorer barfs if this fails.
|
||||
*/
|
||||
public void testMoney() {
|
||||
try {
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
/**
|
||||
* This tests that Money types work. JDBCExplorer barfs if this fails.
|
||||
*/
|
||||
public void testMoney()
|
||||
{
|
||||
try
|
||||
{
|
||||
Connection con = JDBC2Tests.openDB();
|
||||
|
||||
Statement st=con.createStatement();
|
||||
ResultSet rs=st.executeQuery("select cost from test_c");
|
||||
assertNotNull(rs);
|
||||
Statement st = con.createStatement();
|
||||
ResultSet rs = st.executeQuery("select cost from test_c");
|
||||
assertNotNull(rs);
|
||||
|
||||
while(rs.next()){
|
||||
double bd = rs.getDouble(1);
|
||||
}
|
||||
while (rs.next())
|
||||
{
|
||||
double bd = rs.getDouble(1);
|
||||
}
|
||||
|
||||
rs.close();
|
||||
st.close();
|
||||
rs.close();
|
||||
st.close();
|
||||
|
||||
JDBC2Tests.closeDB(con);
|
||||
} catch(Exception ex) {
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
}
|
||||
JDBC2Tests.closeDB(con);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
fail(ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user