summaryrefslogtreecommitdiff
path: root/java/demo/Database/library/Parser.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-08-26 15:32:09 -0230
committerMatthew Newhook <matthew@zeroc.com>2008-08-26 15:32:09 -0230
commitd2d1ae0ca7d03f0b67f5c2086bff18f78331682d (patch)
tree966bdc697be9249585c02dd9dbbb27bfc1695c6b /java/demo/Database/library/Parser.java
parentmove the query objects to the library. (diff)
downloadice-d2d1ae0ca7d03f0b67f5c2086bff18f78331682d.tar.bz2
ice-d2d1ae0ca7d03f0b67f5c2086bff18f78331682d.tar.xz
ice-d2d1ae0ca7d03f0b67f5c2086bff18f78331682d.zip
Minor cleanup, added session timeout.
Diffstat (limited to 'java/demo/Database/library/Parser.java')
-rw-r--r--java/demo/Database/library/Parser.java33
1 files changed, 13 insertions, 20 deletions
diff --git a/java/demo/Database/library/Parser.java b/java/demo/Database/library/Parser.java
index 33f15e80162..281e3762489 100644
--- a/java/demo/Database/library/Parser.java
+++ b/java/demo/Database/library/Parser.java
@@ -170,37 +170,30 @@ class Parser
_current = next.get(0);
}
}
+ else
+ {
+ _current = null;
+ }
printCurrent();
}
void
printCurrent()
{
- try
+ if(_current != null)
{
- if(_current != null)
+ System.out.println("current book is:");
+ System.out.println("isbn: " + _current.isbn);
+ System.out.println("title: " + _current.title);
+ System.out.println("authors: " + _current.authors);
+ if(_current.rentedBy.length() > 0)
{
- System.out.println("current book is:");
- System.out.println("isbn: " + _current.isbn);
- System.out.println("title: " + _current.title);
- System.out.println("authors: " + _current.authors);
- if(_current.rentedBy.length() > 0)
- {
- System.out.println("rented: " + _current.rentedBy);
- }
+ System.out.println("rented: " + _current.rentedBy);
}
- else
- {
- System.out.println("no current book");
- }
- }
- catch(Ice.ObjectNotExistException ex)
- {
- System.out.println("current book no longer exists");
}
- catch(Ice.LocalException ex)
+ else
{
- error(ex.toString());
+ System.out.println("no current book");
}
}