diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-10-25 06:00:05 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-10-25 06:00:05 +0000 |
commit | d2e27b0674e238a4f94f1c190a395a530746d5d3 (patch) | |
tree | d654e117fdc20ecb84da14052fad5124c9f32012 /src/interfaces/jdbc/example/corba/StockItemImpl.java | |
parent | b81844b1738c584d92330a5ccd0fbd8b603d2886 (diff) | |
download | postgresql-d2e27b0674e238a4f94f1c190a395a530746d5d3.tar.gz postgresql-d2e27b0674e238a4f94f1c190a395a530746d5d3.zip |
pgjindent jdbc files. First time jdbc files were formatted.
Diffstat (limited to 'src/interfaces/jdbc/example/corba/StockItemImpl.java')
-rw-r--r-- | src/interfaces/jdbc/example/corba/StockItemImpl.java | 327 |
1 files changed, 186 insertions, 141 deletions
diff --git a/src/interfaces/jdbc/example/corba/StockItemImpl.java b/src/interfaces/jdbc/example/corba/StockItemImpl.java index 7f6c5be9307..598ccd2ddcb 100644 --- a/src/interfaces/jdbc/example/corba/StockItemImpl.java +++ b/src/interfaces/jdbc/example/corba/StockItemImpl.java @@ -5,159 +5,204 @@ import org.omg.CosNaming.*; /** * This class implements the server side of the example. * - * $Id: StockItemImpl.java,v 1.1 1999/01/25 21:22:04 scrappy Exp $ + * $Id: StockItemImpl.java,v 1.2 2001/10/25 05:59:58 momjian Exp $ */ public class StockItemImpl extends stock._StockItemImplBase { - private StockDB db; - private String instanceName; - - public StockItemImpl(String[] args,String iname) { - super(); - try { - db =new StockDB(); - db.connect(args[1],args[2],args[3]); - System.out.println("StockDB object "+iname+" created"); - instanceName = iname; - } catch(Exception e) { - e.printStackTrace(); + private StockDB db; + private String instanceName; + + public StockItemImpl(String[] args, String iname) + { + super(); + try + { + db = new StockDB(); + db.connect(args[1], args[2], args[3]); + System.out.println("StockDB object " + iname + " created"); + instanceName = iname; + } + catch (Exception e) + { + e.printStackTrace(); + } } - } - - /** - * This is defined in stock.idl - * - * It sets the item to view - */ - public void fetchItem(int id) throws stock.StockException { - try { - db.fetchItem(id); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It sets the item to view + */ + public void fetchItem(int id) throws stock.StockException + { + try + { + db.fetchItem(id); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - - /** - * This is defined in stock.idl - * - * It sets the item to view - */ - public int newItem() throws stock.StockException { - try { - return db.newItem(); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + + /** + * This is defined in stock.idl + * + * It sets the item to view + */ + public int newItem() throws stock.StockException + { + try + { + return db.newItem(); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public String getDescription() throws stock.StockException { - try { - return db.getDescription(); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public String getDescription() throws stock.StockException + { + try + { + return db.getDescription(); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public int getAvailable() throws stock.StockException { - try { - return db.getAvailable(); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public int getAvailable() throws stock.StockException + { + try + { + return db.getAvailable(); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public int getOrdered() throws stock.StockException { - try { - return db.getOrdered(); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public int getOrdered() throws stock.StockException + { + try + { + return db.getOrdered(); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public boolean isItemValid() throws stock.StockException { - try { - return db.isItemValid(); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public boolean isItemValid() throws stock.StockException + { + try + { + return db.isItemValid(); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public void addNewStock(int id) throws stock.StockException { - try { - db.addNewStock(id); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public void addNewStock(int id) throws stock.StockException + { + try + { + db.addNewStock(id); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public void removeStock(int id) throws stock.StockException { - try { - db.removeStock(id); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public void removeStock(int id) throws stock.StockException + { + try + { + db.removeStock(id); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This is defined in stock.idl - * - * It returns the description of a Stock item - */ - public void orderStock(int id) throws stock.StockException { - try { - db.orderStock(id); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This is defined in stock.idl + * + * It returns the description of a Stock item + */ + public void orderStock(int id) throws stock.StockException + { + try + { + db.orderStock(id); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } } - } - - /** - * This returns the highest id used, hence the number of items available - */ - public int getLastID() throws stock.StockException { - try { - return db.getLastID(); - } catch(Exception e) { - throw new stock.StockException(e.toString()); + + /** + * This returns the highest id used, hence the number of items available + */ + public int getLastID() throws stock.StockException + { + try + { + return db.getLastID(); + } + catch (Exception e) + { + throw new stock.StockException(e.toString()); + } + } + + /** + * This is used by our Dispenser + */ + public String getInstanceName() + { + return instanceName; } - } - - /** - * This is used by our Dispenser - */ - public String getInstanceName() { - return instanceName; - } } - + |