mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Indent jdbc case labels using pgjindent.
This commit is contained in:
@@ -8,7 +8,7 @@ import java.sql.*;
|
||||
import org.postgresql.largeobject.*;
|
||||
|
||||
/*
|
||||
* $Id: BlobTest.java,v 1.4 2001/11/19 22:33:39 momjian Exp $
|
||||
* $Id: BlobTest.java,v 1.5 2001/11/19 23:16:46 momjian Exp $
|
||||
*
|
||||
* Some simple tests based on problems reported by users. Hopefully these will
|
||||
* help prevent previous problems from re-occuring ;-)
|
||||
@@ -108,36 +108,36 @@ public class BlobTest extends TestCase
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case LOOP:
|
||||
buf = new byte[2048];
|
||||
t = 0;
|
||||
while ((s = fis.read(buf, 0, buf.length)) > 0)
|
||||
{
|
||||
t += s;
|
||||
blob.write(buf, 0, s);
|
||||
}
|
||||
break;
|
||||
case LOOP:
|
||||
buf = new byte[2048];
|
||||
t = 0;
|
||||
while ((s = fis.read(buf, 0, buf.length)) > 0)
|
||||
{
|
||||
t += s;
|
||||
blob.write(buf, 0, s);
|
||||
}
|
||||
break;
|
||||
|
||||
case NATIVE_STREAM:
|
||||
os = blob.getOutputStream();
|
||||
s = fis.read();
|
||||
while (s > -1)
|
||||
{
|
||||
os.write(s);
|
||||
case NATIVE_STREAM:
|
||||
os = blob.getOutputStream();
|
||||
s = fis.read();
|
||||
}
|
||||
os.close();
|
||||
break;
|
||||
while (s > -1)
|
||||
{
|
||||
os.write(s);
|
||||
s = fis.read();
|
||||
}
|
||||
os.close();
|
||||
break;
|
||||
|
||||
case JDBC_STREAM:
|
||||
File f = new File(file);
|
||||
PreparedStatement ps = con.prepareStatement(JDBC2Tests.insertSQL("testblob", "?"));
|
||||
ps.setBinaryStream(1, fis, (int) f.length());
|
||||
ps.execute();
|
||||
break;
|
||||
case JDBC_STREAM:
|
||||
File f = new File(file);
|
||||
PreparedStatement ps = con.prepareStatement(JDBC2Tests.insertSQL("testblob", "?"));
|
||||
ps.setBinaryStream(1, fis, (int) f.length());
|
||||
ps.execute();
|
||||
break;
|
||||
|
||||
default:
|
||||
assertTrue("Unknown method in uploadFile", false);
|
||||
default:
|
||||
assertTrue("Unknown method in uploadFile", false);
|
||||
}
|
||||
|
||||
blob.close();
|
||||
|
@@ -21,7 +21,7 @@ public class ResultSetTest extends TestCase
|
||||
{
|
||||
con = JDBC2Tests.openDB();
|
||||
Statement stmt = con.createStatement();
|
||||
|
||||
|
||||
JDBC2Tests.createTable(con, "testrs", "id integer");
|
||||
|
||||
stmt.executeUpdate("INSERT INTO testrs VALUES (1)");
|
||||
@@ -44,23 +44,23 @@ public class ResultSetTest extends TestCase
|
||||
{
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery("SELECT * FROM testrs");
|
||||
|
||||
assertTrue(rs.absolute(-1));
|
||||
|
||||
assertTrue(rs.absolute( -1));
|
||||
assertEquals(6, rs.getRow());
|
||||
|
||||
assertTrue(rs.absolute(1));
|
||||
assertEquals(1, rs.getRow());
|
||||
|
||||
assertTrue(!rs.absolute(-10));
|
||||
assertTrue(!rs.absolute( -10));
|
||||
assertEquals(0, rs.getRow());
|
||||
assertTrue(rs.next());
|
||||
assertEquals(1, rs.getRow());
|
||||
assertTrue(rs.next());
|
||||
assertEquals(1, rs.getRow());
|
||||
|
||||
assertTrue(!rs.absolute(10));
|
||||
assertEquals(0, rs.getRow());
|
||||
assertTrue(rs.previous());
|
||||
assertEquals(6, rs.getRow());
|
||||
|
||||
|
||||
stmt.close();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user