More jdbc comment cleanups. Code looks very nice now.
authorBruce Momjian
Mon, 19 Nov 2001 22:43:13 +0000 (22:43 +0000)
committerBruce Momjian
Mon, 19 Nov 2001 22:43:13 +0000 (22:43 +0000)
14 files changed:
src/interfaces/jdbc/example/ImageViewer.java
src/interfaces/jdbc/example/Unicode.java
src/interfaces/jdbc/example/basic.java
src/interfaces/jdbc/example/blobtest.java
src/interfaces/jdbc/example/corba/StockClient.java
src/interfaces/jdbc/example/corba/StockDB.java
src/interfaces/jdbc/example/corba/StockDispenserImpl.java
src/interfaces/jdbc/example/corba/StockItemImpl.java
src/interfaces/jdbc/example/corba/StockServer.java
src/interfaces/jdbc/example/datestyle.java
src/interfaces/jdbc/example/metadata.java
src/interfaces/jdbc/example/psql.java
src/interfaces/jdbc/example/threadsafe.java
src/interfaces/jdbc/utils/CheckVersion.java

index 6097439bab3e652fc6faf0a4f83bffb7d6758be6..9540bfa67edaafc5c19adf39638db0c36aea39de 100644 (file)
@@ -6,7 +6,7 @@ import java.io.*;
 import java.sql.*;
 import org.postgresql.largeobject.*;
 
-/**
+/*
  * This example is a small application that stores and displays images
  * held on a postgresql database.
  *
@@ -81,7 +81,7 @@ public class ImageViewer implements ItemListener
            paint(g);
        }
 
-       /**
+       /*
         * Paints the image, using double buffering to prevent screen flicker
         */
        public void paint(Graphics gr)
@@ -212,7 +212,7 @@ public class ImageViewer implements ItemListener
    }
 
 
-   /**
+   /*
     * This method initialises the database by creating a table that contains
     * the image names, and Large Object OID's
     */
@@ -238,7 +238,7 @@ public class ImageViewer implements ItemListener
        //}
    }
 
-   /**
+   /*
     * This closes the connection, and ends the application
     */
    public void close()
@@ -254,7 +254,7 @@ public class ImageViewer implements ItemListener
        System.exit(0);
    }
 
-   /**
+   /*
     * This imports an image into the database, using a Thread to do this in the
     * background.
     */
@@ -272,7 +272,7 @@ public class ImageViewer implements ItemListener
        t.start();
    }
 
-   /**
+   /*
     * This is an example of using a thread to import a file into a Large Object.
     * It uses the Large Object extension, to write blocks of the file to the
     * database.
@@ -362,7 +362,7 @@ public class ImageViewer implements ItemListener
        }
    }
 
-   /**
+   /*
     * This refreshes the list of available images
     */
    public void refreshList()
@@ -385,7 +385,7 @@ public class ImageViewer implements ItemListener
        }
    }
 
-   /**
+   /*
     * This removes an image from the database
     *
     * Note: With postgresql, this is the only way of deleting a large object
@@ -427,7 +427,7 @@ public class ImageViewer implements ItemListener
        }
    }
 
-   /**
+   /*
     * This displays an image from the database.
     *
     * For images, this is the easiest method.
@@ -476,7 +476,7 @@ public class ImageViewer implements ItemListener
        displayImage(list.getItem(((Integer)e.getItem()).intValue()));
    }
 
-   /**
+   /*
     * This is the command line instructions
     */
    public static void instructions()
@@ -489,7 +489,7 @@ public class ImageViewer implements ItemListener
        System.err.println("Note: If you are running this for the first time on a particular database,\nyou have to select \"Initialise\" in the \"PostgreSQL\" menu.\nThis will create a table used to store image names.");
    }
 
-   /**
+   /*
     * This is the application entry point
     */
    public static void main(String args[])
index f5e56522f504e0b493ec078e1e2264db560d152c..0d84c719a509ae9038dea8607d865c3eb6eefbf2 100644 (file)
@@ -4,7 +4,7 @@ import java.io.*;
 import java.sql.*;
 import java.util.*;
 
-/**
+/*
  * Test inserting and extracting Unicode-encoded strings.
  *
  * Synopsis:
@@ -22,17 +22,17 @@ import java.util.*;
 public class Unicode
 {
 
-   /**
+   /*
     *  The url for the database to connect to.
     */
    private String url;
 
-   /**
+   /*
     *  The user to connect as.
     */
    private String user;
 
-   /**
+   /*
     *  The password to connect with.
     */
    private String password;
@@ -61,7 +61,7 @@ public class Unicode
        this.password = password;
    }
 
-   /**
+   /*
     *  Establish and return a connection to the database.
     */
    private Connection getConnection() throws SQLException,
@@ -75,7 +75,7 @@ public class Unicode
        return DriverManager.getConnection(url, info);
    }
 
-   /**
+   /*
     *  Get string representing a block of 256 consecutive unicode characters.
     *  We exclude the null character, "'",  and "\".
     */
@@ -97,7 +97,7 @@ public class Unicode
        return sb.toString();
    }
 
-   /**
+   /*
     *  Is the block a block of valid unicode values.
     *  d800 to db7f is the "unassigned high surrogate" range.
     *  db80 to dbff is the "private use" range.
@@ -112,7 +112,7 @@ public class Unicode
            return true;
    }
 
-   /**
+   /*
     *  Report incorrect block retrieval.
     */
    private void reportRetrievalError(int blockNum, String block,
@@ -142,7 +142,7 @@ public class Unicode
        log(message);
    }
 
-   /**
+   /*
     *  Do the testing.
     */
    public void runTest()
index 8dd7d7baf75272cb3ece6d12de5121392e23bb45..61b35abc4590579f8183e579ef8bf60216d13e5b 100644 (file)
@@ -4,9 +4,9 @@ import java.io.*;
 import java.sql.*;
 import java.text.*;
 
-/**
+/*
  *
- * $Id: basic.java,v 1.8 2001/10/25 05:59:58 momjian Exp $
+ * $Id: basic.java,v 1.9 2001/11/19 22:43:13 momjian Exp $
  *
  * This example tests the basic components of the JDBC driver, and shows
  * how even the simplest of queries can be implemented.
@@ -56,7 +56,7 @@ public class basic
        //throw postgresql.Driver.notImplemented();
    }
 
-   /**
+   /*
     * This drops the table (if it existed). No errors are reported.
     */
    public void cleanup()
@@ -71,7 +71,7 @@ public class basic
        }
    }
 
-   /**
+   /*
     * This performs the example
     */
    public void doexample() throws SQLException
@@ -178,7 +178,7 @@ public class basic
        // cleanup() method.
    }
 
-   /**
+   /*
     * Display some instructions on how to run the example
     */
    public static void instructions()
@@ -188,7 +188,7 @@ public class basic
        System.exit(1);
    }
 
-   /**
+   /*
     * This little lot starts the test
     */
    public static void main(String args[])
index 654eaf92acd4d115a4ac06ba93553f36e00aae1a..bfa0cc42959d2981236d0bd42cd99181dcdb36e8 100644 (file)
@@ -4,7 +4,7 @@ import java.io.*;
 import java.sql.*;
 import org.postgresql.largeobject.*;
 
-/**
+/*
  * This test attempts to create a blob in the database, then to read
  * it back.
  *
@@ -64,7 +64,7 @@ public class blobtest
 
    }
 
-   /**
+   /*
     * Now this is an extension to JDBC, unique to postgresql. Here we fetch
     * an PGlobj object, which provides us with access to postgresql's
     * large object api.
index 0a357b15cafc38c51dbe046e92b16f3bb86c504b..3ccb28c7fd84cecda877635e93477999dd0a03bd 100644 (file)
@@ -4,12 +4,12 @@ import java.io.*;
 import java.sql.*;
 import org.omg.CosNaming.*;
 
-/**
+/*
  * This class is the frontend to our mini CORBA application.
  *
  * It has no GUI, just a text frontend to keep it simple.
  *
- * $Id: StockClient.java,v 1.2 2001/10/25 05:59:58 momjian Exp $
+ * $Id: StockClient.java,v 1.3 2001/11/19 22:43:13 momjian Exp $
  */
 public class StockClient
 {
index 88797902ddb3de274d7dd8fc9617e918d5831600..47144983cda62493a02564aad58d97dab891dbd7 100644 (file)
@@ -2,7 +2,7 @@ package example.corba;
 
 import java.sql.*;
 
-/**
+/*
  * This class handles the JDBC side of things. It opens a connection to
  * the database, and performes queries on that database.
  *
@@ -13,7 +13,7 @@ import java.sql.*;
  * that an object could be changed by another client, and we need to ensure that
  * the returned data is live and accurate.
  *
- * $Id: StockDB.java,v 1.3 2001/10/25 05:59:58 momjian Exp $
+ * $Id: StockDB.java,v 1.4 2001/11/19 22:43:13 momjian Exp $
  */
 public class StockDB
 {
index 9572d20ae7fdb19314eaa858f67c1d46ae199b6e..54e461813396ce33464c9ef813b9cec916e00f51 100644 (file)
@@ -2,10 +2,10 @@ package example.corba;
 
 import org.omg.CosNaming.*;
 
-/**
+/*
  * This class implements the server side of the example.
  *
- * $Id: StockDispenserImpl.java,v 1.2 2001/10/25 05:59:58 momjian Exp $
+ * $Id: StockDispenserImpl.java,v 1.3 2001/11/19 22:43:13 momjian Exp $
  */
 public class StockDispenserImpl extends stock._StockDispenserImplBase
 {
@@ -39,7 +39,7 @@ public class StockDispenserImpl extends stock._StockDispenserImplBase
        }
    }
 
-   /**
+   /*
     * This method, defined in stock.idl, reserves a slot in the dispenser
     */
    public stock.StockItem reserveItem() throws stock.StockException
@@ -56,7 +56,7 @@ public class StockDispenserImpl extends stock._StockDispenserImplBase
        return null;
    }
 
-   /**
+   /*
     * This releases a slot from the dispenser
     */
    public void releaseItem(stock.StockItem item) throws stock.StockException
@@ -74,7 +74,7 @@ public class StockDispenserImpl extends stock._StockDispenserImplBase
        return ;
    }
 
-   /**
+   /*
     * This class defines a slot in the dispenser
     */
    class StockItemStatus
index 598ccd2ddcb7b4f8669a21012b36a87fdf17a5c0..f504ab8dfe7437f9d0500d5c09ac58f711bc6994 100644 (file)
@@ -2,10 +2,10 @@ package example.corba;
 
 import org.omg.CosNaming.*;
 
-/**
+/*
  * This class implements the server side of the example.
  *
- * $Id: StockItemImpl.java,v 1.2 2001/10/25 05:59:58 momjian Exp $
+ * $Id: StockItemImpl.java,v 1.3 2001/11/19 22:43:13 momjian Exp $
  */
 public class StockItemImpl extends stock._StockItemImplBase
 {
@@ -28,7 +28,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It sets the item to view
@@ -46,7 +46,7 @@ public class StockItemImpl extends stock._StockItemImplBase
    }
 
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It sets the item to view
@@ -63,7 +63,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -80,7 +80,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -97,7 +97,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -114,7 +114,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -131,7 +131,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -148,7 +148,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -165,7 +165,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is defined in stock.idl
     *
     * It returns the description of a Stock item
@@ -182,7 +182,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This returns the highest id used, hence the number of items available
     */
    public int getLastID() throws stock.StockException
@@ -197,7 +197,7 @@ public class StockItemImpl extends stock._StockItemImplBase
        }
    }
 
-   /**
+   /*
     * This is used by our Dispenser
     */
    public String getInstanceName()
index 43465a944e8a60561ff0e74118558b01d8495500..77d8946389b0910d2281399d11362815f5532321 100644 (file)
@@ -2,10 +2,10 @@ package example.corba;
 
 import org.omg.CosNaming.*;
 
-/**
+/*
  * This class implements the server side of the example.
  *
- * $Id: StockServer.java,v 1.2 2001/10/25 05:59:58 momjian Exp $
+ * $Id: StockServer.java,v 1.3 2001/11/19 22:43:13 momjian Exp $
  */
 public class StockServer
 {
index 53908c8c2fa6dfe0ece377cf8086c7d446b7c58d..6e503552b70d21a98e03c8443f1468fce93ddfa4 100644 (file)
@@ -4,7 +4,7 @@ import java.io.*;
 import java.sql.*;
 import java.text.*;
 
-/**
+/*
  * This example tests the various date styles that are available to postgresql.
  *
  * To use this example, you need a database to be in existence. This example
@@ -64,7 +64,7 @@ public class datestyle
 
    }
 
-   /**
+   /*
     * This drops the table (if it existed). No errors are reported.
     */
    public void cleanup()
@@ -79,7 +79,7 @@ public class datestyle
        }
    }
 
-   /**
+   /*
     * This initialises the database for this example
     */
    public void init() throws SQLException
@@ -108,7 +108,7 @@ public class datestyle
 
    }
 
-   /**
+   /*
     * This performs the example
     */
    public void doexample() throws SQLException
@@ -150,7 +150,7 @@ public class datestyle
        }
    }
 
-   /**
+   /*
     * Display some instructions on how to run the example
     */
    public static void instructions()
@@ -160,7 +160,7 @@ public class datestyle
        System.exit(1);
    }
 
-   /**
+   /*
     * This little lot starts the test
     */
    public static void main(String args[])
index 182e4533e0cb281195ccfb8cb55128c4adbd7f35..6cd2802456c478a285323068df7b657e05b42a60 100644 (file)
@@ -4,7 +4,7 @@ import java.io.*;
 import java.sql.*;
 import java.text.*;
 
-/**
+/*
  * This example application is not really an example. It actually performs
  * some tests on various methods in the DatabaseMetaData and ResultSetMetaData
  * classes.
@@ -19,7 +19,7 @@ public class metadata
    Statement   st;     // Our statement to run queries with
    DatabaseMetaData dbmd;  // This defines the structure of the database
 
-   /**
+   /*
     * These are the available tests on DatabaseMetaData
     */
    public void doDatabaseMetaData() throws SQLException
@@ -53,7 +53,7 @@ public class metadata
 
    }
 
-   /**
+   /*
     * These are the available tests on ResultSetMetaData
     */
    public void doResultSetMetaData() throws SQLException
@@ -81,7 +81,7 @@ public class metadata
            rs.close();
    }
 
-   /**
+   /*
     * This creates some test data
     */
    public void init() throws SQLException
@@ -98,7 +98,7 @@ public class metadata
        st.executeUpdate("insert into test_c values ('nowhere particular','$10.99',1)");
    }
 
-   /**
+   /*
     * This removes the test data
     */
    public void cleanup() throws SQLException
@@ -152,7 +152,7 @@ public class metadata
        cleanup();
    }
 
-   /**
+   /*
     * This asks if the user requires to run a test.
     */
    public boolean doTest(String s)
@@ -177,7 +177,7 @@ public class metadata
        return c == 'y' || c == 'Y';
    }
 
-   /**
+   /*
     * This displays a result set.
     * Note: it closes the result once complete.
     */
@@ -211,7 +211,7 @@ public class metadata
        rs.close();
    }
 
-   /**
+   /*
     * This process / commands (for now just /d)
     */
    public void processSlashCommand(String line) throws SQLException
@@ -259,7 +259,7 @@ public class metadata
    private static final String usrSequences[] = {"SEQUENCE"};
    private static final String sysTables[] = {"SYSTEM TABLE", "SYSTEM INDEX"};
 
-   /**
+   /*
     * Display some instructions on how to run the example
     */
    public static void instructions()
@@ -269,7 +269,7 @@ public class metadata
        System.exit(1);
    }
 
-   /**
+   /*
     * This little lot starts the test
     */
    public static void main(String args[])
index b3fd308cd7bc0e858d9e2a3c44af4a11b2854c17..697198ce3a6195f0849cc68462b76f82d3ef1a82 100644 (file)
@@ -4,7 +4,7 @@ import java.io.*;
 import java.sql.*;
 import java.text.*;
 
-/**
+/*
  * This example application demonstrates some of the drivers other features
  * by implementing a simple psql replacement in Java.
  *
@@ -75,7 +75,7 @@ public class psql
 
    }
 
-   /**
+   /*
     * This processes a statement
     */
    public void processLine(String line) throws SQLException
@@ -117,7 +117,7 @@ public class psql
        }
    }
 
-   /**
+   /*
     * This displays a result set.
     * Note: it closes the result once complete.
     */
@@ -147,7 +147,7 @@ public class psql
        rs.close();
    }
 
-   /**
+   /*
     * This process / commands (for now just /d)
     */
    public void processSlashCommand(String line) throws SQLException
@@ -197,7 +197,7 @@ public class psql
    private static final String usrSequences[] = {"SEQUENCE"};
    private static final String sysTables[] = {"SYSTEM TABLE", "SYSTEM INDEX"};
 
-   /**
+   /*
     * Display some instructions on how to run the example
     */
    public static void instructions()
@@ -207,7 +207,7 @@ public class psql
        System.exit(1);
    }
 
-   /**
+   /*
     * This little lot starts the test
     */
    public static void main(String args[])
index 2931221f1810492864d85177e110b92ba91e2266..ceb1ef8f6f5d3694aebebd782c77d2edcfefd2e3 100644 (file)
@@ -7,7 +7,7 @@ import java.text.*;
 // rare in user code, but we use the LargeObject API in this test
 import org.postgresql.largeobject.*;
 
-/**
+/*
  * This example tests the thread safety of the driver.
  *
  * It does this by performing several queries, in different threads. Each
@@ -56,7 +56,7 @@ public class threadsafe
 
    }
 
-   /**
+   /*
     * This drops the table (if it existed). No errors are reported.
     */
    public void cleanup()
@@ -80,7 +80,7 @@ public class threadsafe
        }
    }
 
-   /**
+   /*
     * This performs the example
     */
    public void doexample() throws SQLException
@@ -366,7 +366,7 @@ public class threadsafe
        }
    }
 
-   /**
+   /*
     * Display some instructions on how to run the example
     */
    public static void instructions()
@@ -376,7 +376,7 @@ public class threadsafe
        System.exit(1);
    }
 
-   /**
+   /*
     * This little lot starts the test
     */
    public static void main(String args[])
index 74c40813cdb31053c2d7a1295ccc18864f806acf..a2438cd4f9f3380241d5f88c416bdadd17d6b29b 100644 (file)
@@ -1,13 +1,13 @@
 package utils;
 
-/**
+/*
  * This little app checks to see what version of JVM is being used.
  * It does this by checking first the java.vm.version property, and
  * if that fails, it looks for certain classes that should be present.
  */
 public class CheckVersion
 {
-   /**
+   /*
     * Check for the existence of a class by attempting to load it
     */
    public static boolean checkClass(String c)
@@ -23,7 +23,7 @@ public class CheckVersion
        return true;
    }
 
-   /**
+   /*
     * This first checks java.vm.version for 1.1, 1.2 or 1.3.
     *
     * It writes jdbc1 to stdout for the 1.1.x VM.