aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/example
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/jdbc/example')
-rw-r--r--src/interfaces/jdbc/example/ImageViewer.java1
-rw-r--r--src/interfaces/jdbc/example/Unicode.java30
-rw-r--r--src/interfaces/jdbc/example/basic.java4
-rw-r--r--src/interfaces/jdbc/example/blobtest.java4
-rw-r--r--src/interfaces/jdbc/example/corba/StockClient.java38
-rw-r--r--src/interfaces/jdbc/example/datestyle.java2
-rw-r--r--src/interfaces/jdbc/example/metadata.java1
-rw-r--r--src/interfaces/jdbc/example/psql.java3
-rw-r--r--src/interfaces/jdbc/example/threadsafe.java2
9 files changed, 38 insertions, 47 deletions
diff --git a/src/interfaces/jdbc/example/ImageViewer.java b/src/interfaces/jdbc/example/ImageViewer.java
index 9540bfa67ed..f61a8870e7b 100644
--- a/src/interfaces/jdbc/example/ImageViewer.java
+++ b/src/interfaces/jdbc/example/ImageViewer.java
@@ -291,7 +291,6 @@ public class ImageViewer implements ItemListener
public void run()
{
-
// Now the real import stuff
if (name != null && dir != null)
{
diff --git a/src/interfaces/jdbc/example/Unicode.java b/src/interfaces/jdbc/example/Unicode.java
index 0d84c719a50..2312742235b 100644
--- a/src/interfaces/jdbc/example/Unicode.java
+++ b/src/interfaces/jdbc/example/Unicode.java
@@ -214,21 +214,21 @@ public class Unicode
{
switch (mode)
{
- case CREATE:
- log("Exception creating database", sqle);
- break;
- case INSERT:
- log("Exception inserting block " + blockNum, sqle);
- break;
- case SELECT:
- log("Exception selecting block " + blockNum, sqle);
- break;
- case LIKE:
- log("Exception doing LIKE on block " + blockNum, sqle);
- break;
- default:
- log("Exception", sqle);
- break;
+ case CREATE:
+ log("Exception creating database", sqle);
+ break;
+ case INSERT:
+ log("Exception inserting block " + blockNum, sqle);
+ break;
+ case SELECT:
+ log("Exception selecting block " + blockNum, sqle);
+ break;
+ case LIKE:
+ log("Exception doing LIKE on block " + blockNum, sqle);
+ break;
+ default:
+ log("Exception", sqle);
+ break;
}
}
catch (ClassNotFoundException cnfe)
diff --git a/src/interfaces/jdbc/example/basic.java b/src/interfaces/jdbc/example/basic.java
index 61b35abc459..f01cb9cb8c5 100644
--- a/src/interfaces/jdbc/example/basic.java
+++ b/src/interfaces/jdbc/example/basic.java
@@ -6,7 +6,7 @@ import java.text.*;
/*
*
- * $Id: basic.java,v 1.9 2001/11/19 22:43:13 momjian Exp $
+ * $Id: basic.java,v 1.10 2001/11/19 23:16:44 momjian Exp $
*
* This example tests the basic components of the JDBC driver, and shows
* how even the simplest of queries can be implemented.
@@ -137,6 +137,7 @@ public class basic
// Now run the query again, showing a more efficient way of getting the
// result if you don't know what column number a value is in
+
System.out.println("performing another query");
rs = st.executeQuery("select * from basic where b>1");
if (rs != null)
@@ -163,6 +164,7 @@ public class basic
// Now test maxrows by setting it to 3 rows
+
st.setMaxRows(3);
System.out.println("performing a query limited to " + st.getMaxRows());
rs = st.executeQuery("select a, b from basic");
diff --git a/src/interfaces/jdbc/example/blobtest.java b/src/interfaces/jdbc/example/blobtest.java
index bfa0cc42959..271026250dd 100644
--- a/src/interfaces/jdbc/example/blobtest.java
+++ b/src/interfaces/jdbc/example/blobtest.java
@@ -61,7 +61,6 @@ public class blobtest
System.out.println("Now closing the connection");
s.close();
db.close();
-
}
/*
@@ -171,7 +170,6 @@ public class blobtest
lobj.unlink(oid);
}
- //=======================================================================
// This tests the Blob interface of the JDBC 2.0 specification
public void jdbc2api(int oid) throws SQLException, IOException
{
@@ -218,8 +216,6 @@ public class blobtest
db.setAutoCommit(false);
}
- //=======================================================================
-
public static void instructions()
{
System.err.println("java example.blobtest jdbc-url user password [debug]");
diff --git a/src/interfaces/jdbc/example/corba/StockClient.java b/src/interfaces/jdbc/example/corba/StockClient.java
index 3ccb28c7fd8..519bf49f97d 100644
--- a/src/interfaces/jdbc/example/corba/StockClient.java
+++ b/src/interfaces/jdbc/example/corba/StockClient.java
@@ -9,7 +9,7 @@ import org.omg.CosNaming.*;
*
* It has no GUI, just a text frontend to keep it simple.
*
- * $Id: StockClient.java,v 1.3 2001/11/19 22:43:13 momjian Exp $
+ * $Id: StockClient.java,v 1.4 2001/11/19 23:16:45 momjian Exp $
*/
public class StockClient
{
@@ -116,29 +116,29 @@ public class StockClient
int i = getMenu("Main", 5);
switch (i)
{
- case 0:
- run = false;
- break;
+ case 0:
+ run = false;
+ break;
- case 1:
- displayItem();
- break;
+ case 1:
+ displayItem();
+ break;
- case 2:
- bookOut();
- break;
+ case 2:
+ bookOut();
+ break;
- case 3:
- bookIn();
- break;
+ case 3:
+ bookIn();
+ break;
- case 4:
- order(0);
- break;
+ case 4:
+ order(0);
+ break;
- case 5:
- displayAll();
- break;
+ case 5:
+ displayAll();
+ break;
}
}
}
diff --git a/src/interfaces/jdbc/example/datestyle.java b/src/interfaces/jdbc/example/datestyle.java
index 6e503552b70..4cf40159ca1 100644
--- a/src/interfaces/jdbc/example/datestyle.java
+++ b/src/interfaces/jdbc/example/datestyle.java
@@ -9,7 +9,6 @@ import java.text.*;
*
* To use this example, you need a database to be in existence. This example
* will create a table called datestyle.
- *
*/
public class datestyle
@@ -105,7 +104,6 @@ public class datestyle
ps.setDate(1, standard);
ps.executeUpdate();
ps.close();
-
}
/*
diff --git a/src/interfaces/jdbc/example/metadata.java b/src/interfaces/jdbc/example/metadata.java
index 6cd2802456c..468af6b9598 100644
--- a/src/interfaces/jdbc/example/metadata.java
+++ b/src/interfaces/jdbc/example/metadata.java
@@ -218,7 +218,6 @@ public class metadata
{
if (line.startsWith("\\d"))
{
-
if (line.startsWith("\\d "))
{
// Display details about a table
diff --git a/src/interfaces/jdbc/example/psql.java b/src/interfaces/jdbc/example/psql.java
index 697198ce3a6..a5af214d574 100644
--- a/src/interfaces/jdbc/example/psql.java
+++ b/src/interfaces/jdbc/example/psql.java
@@ -50,7 +50,7 @@ public class psql
// Now the main loop.
int tt = 0, lineno = 1;
while (tt != StreamTokenizer.TT_EOF && ! done)
- { // done added by CWJ to permit \q command
+ {
System.out.print("[" + lineno + "] ");
System.out.flush();
@@ -72,7 +72,6 @@ public class psql
System.out.println("Now closing the connection");
st.close();
db.close();
-
}
/*
diff --git a/src/interfaces/jdbc/example/threadsafe.java b/src/interfaces/jdbc/example/threadsafe.java
index ceb1ef8f6f5..cca7be75bee 100644
--- a/src/interfaces/jdbc/example/threadsafe.java
+++ b/src/interfaces/jdbc/example/threadsafe.java
@@ -53,7 +53,6 @@ public class threadsafe
System.out.println("Now closing the connection");
st.close();
db.close();
-
}
/*
@@ -108,7 +107,6 @@ public class threadsafe
System.out.println("Waiting for threads to run");
while (thread1.isAlive() || thread2.isAlive() || thread3.isAlive())
thread0.yield();
-
}
finally
{