2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
8 import java
.io
.FileOutputStream
;
9 import java
.io
.FileWriter
;
10 import java
.io
.IOException
;
11 import java
.io
.InputStream
;
12 import java
.util
.ArrayList
;
13 import java
.util
.prefs
.Preferences
;
15 import java
.text
.DateFormat
;
16 import java
.text
.MessageFormat
;
17 import java
.text
.SimpleDateFormat
;
18 import java
.util
.logging
.Level
;
19 import java
.util
.logging
.Logger
;
25 public class Utility
{
27 private static final String
[] REPORTS_UNFILTERED
= { "SELECT ReferenceNumber, Description"
28 + ", BillDate, BillAmount, ClientName FROM legalnotices INNER JOIN "
29 + "clients ON ClientId=clients.id WHERE BillStatus='AWAITING PAYMENT';",
31 "SELECT ReferenceNumber, Description, SentDate, RPADReference, "
32 + "ClientName FROM legalnotices INNER JOIN clients ON ClientId=clients.id"
33 + " WHERE NoticeSent=1 AND NoticeDelivered=0;",
35 "SELECT ReferenceNumber, Description, EntrustmentDate, ClientName FROM legalnotices"
36 + " INNER JOIN clients ON ClientId=clients.id"
37 + " WHERE DraftCreated=1 AND DraftApproved=0;",
39 "SELECT ReferenceNumber, Description, EntrustmentDate, "
40 + "ClarificationRemarks, ClientName FROM legalnotices INNER JOIN clients ON"
41 + " ClientId=clients.id WHERE ClarificationPending=1;",
43 "SELECT ReferenceNumber, Description, EntrustmentDate, ClarificationRemarks"
44 + ", ClientName from legalnotices INNER JOIN clients ON ClientId=clients.id "
45 + "WHERE DraftCreated=0;",
47 "SELECT ReferenceNumber, Description, EntrustmentDate, ClientName FROM"
48 + " legalnotices INNER JOIN clients ON ClientId=clients.id WHERE "
49 + " DraftApproved=1 AND NoticeSent=0;"
52 private static final String
[] REPORTS_FILTERED
= { "SELECT ReferenceNumber, Description"
53 + ", BillDate, BillAmount, ClientName FROM legalnotices INNER JOIN "
54 + "clients ON ClientId=clients.id WHERE BillStatus='AWAITING PAYMENT' "
57 "SELECT ReferenceNumber, Description, SentDate, RPADReference, "
58 + "ClientName FROM legalnotices INNER JOIN clients ON ClientId=clients.id"
59 + " WHERE NoticeSent=1 AND NoticeDelivered=0 AND ClientId=?;",
61 "SELECT ReferenceNumber, Description, EntrustmentDate, ClientName FROM legalnotices"
62 + " INNER JOIN clients ON ClientId=clients.id"
63 + " WHERE DraftCreated=1 AND DraftApproved=0 AND ClientId=?;",
65 "SELECT ReferenceNumber, Description, EntrustmentDate, "
66 + "ClarificationRemarks, ClientName FROM legalnotices INNER JOIN clients ON"
67 + " ClientId=clients.id WHERE ClarificationPending=1 AND ClientId=?;",
69 "SELECT ReferenceNumber, Description, EntrustmentDate, ClarificationRemarks"
70 + ", ClientName from legalnotices INNER JOIN clients ON ClientId=clients.id "
71 + "WHERE DraftCreated=0 AND ClientId=?;",
73 "SELECT ReferenceNumber, Description, EntrustmentDate, ClientName FROM"
74 + " legalnotices INNER JOIN clients ON ClientId=clients.id WHERE "
75 + " DraftApproved=1 AND NoticeSent=0 AND ClientId=?;"
78 static void saveStationerySettings (String left_header
,
79 String right_header
, String signatory
) {
80 leftLetterHeader
= left_header
;
81 rightLetterHeader
= right_header
;
82 signatoryName
= signatory
;
83 Preferences myPrefs
= Preferences
.userRoot().node("org/harishankar/Habeas");
84 myPrefs
.put ("LeftHeader", left_header
);
85 myPrefs
.put ("RightHeader", right_header
);
86 myPrefs
.put ("Signatory", signatory
);
89 static void retrieveStationerySettings () {
90 Preferences myPrefs
= Preferences
.userRoot().node ("org/harishankar/Habeas");
91 leftLetterHeader
= myPrefs
.get("LeftHeader", "Left Header");
92 rightLetterHeader
= myPrefs
.get ("RightHeader", "Right Header");
93 signatoryName
= myPrefs
.get ("Signatory", "Signatory Name");
96 static void saveConnectionURL(String text
) {
98 Preferences myPrefs
= Preferences
.userRoot().node ("org/harishankar/Habeas");
99 myPrefs
.put("ConnectionURL", text
);
102 static ArrayList
<Object
> getClientDetails(int r
) {
103 ArrayList
<Object
> res
= new ArrayList
<>();
105 Connection conn
= DriverManager
.getConnection(JDBC
+connectionURL
);
106 PreparedStatement st
= conn
.prepareStatement("SELECT * FROM clients WHERE id=?;");
108 ResultSet rs
= st
.executeQuery();
110 res
.add (rs
.getString("ClientName"));
111 res
.add(rs
.getString("ClientAddress"));
112 res
.add (rs
.getString("ContactPerson"));
113 res
.add (rs
.getString("MailID"));
114 res
.add (rs
.getString("ContactNumber"));
119 } catch (SQLException ex
) {
120 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
126 static boolean addClient(String client_name
, String client_address
,
127 String contact_person
, String email_id
, String phone_number
) {
128 if ("".equals(client_name
))
131 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
132 PreparedStatement st
= conn
.prepareStatement("INSERT INTO clients (ClientName,"
133 + "ClientAddress, ContactPerson, MailID, ContactNumber) VALUES (?, ?, ?, ?, ?);");
134 st
.setString(1, client_name
);
135 st
.setString(2, client_address
);
136 st
.setString(3, contact_person
);
137 st
.setString (4, email_id
);
138 st
.setString (5, phone_number
);
143 } catch (SQLException ex
) {
144 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
151 static boolean deleteClient(int r
) {
153 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
154 PreparedStatement st
= conn
.prepareStatement("DELETE FROM clients WHERE id=?;");
155 PreparedStatement st2
= conn
.prepareStatement("DELETE FROM legalnotices WHERE ClientId=?;");
162 } catch (SQLException ex
) {
163 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
169 static boolean updateClient(int r
, String client_name
, String client_address
,
170 String contact_person
, String mail_id
, String phone_number
) {
171 if ("".equals(client_name
))
174 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
175 PreparedStatement st
= conn
.prepareStatement("UPDATE clients SET "
176 + "ClientName=?, ClientAddress=?,"
177 + "ContactPerson=?, MailID=?, ContactNumber=? WHERE id=?;");
178 st
.setString(1, client_name
);
179 st
.setString(2, client_address
);
180 st
.setString(3, contact_person
);
181 st
.setString(4, mail_id
);
182 st
.setString(5, phone_number
);
187 } catch (SQLException ex
) {
188 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
195 static boolean addLegalNotice(String reference_number
,
196 String description
, java
.util
.Date entrustment_date
, DBItem client
) {
197 if ("".equals(reference_number
) || "".equals(description
) ||
198 entrustment_date
== null || client
== null)
201 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
202 PreparedStatement st
= conn
.prepareStatement("INSERT INTO legalnotices"
203 + " (ReferenceNumber, Description, EntrustmentDate, ClientId) "
204 + "VALUES (?, ?, ?, ?);");
205 st
.setString(1, reference_number
);
206 st
.setString(2, description
);
207 st
.setLong(3, entrustment_date
.getTime()/1000);
208 st
.setInt (4, client
.getKey());
213 } catch (SQLException ex
) {
214 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
220 static ArrayList
<Object
> getNotices() {
221 ArrayList
<Object
> notices
= new ArrayList
<>();
223 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
224 Statement st
= conn
.createStatement();
225 ResultSet rs
= st
.executeQuery("SELECT id, ReferenceNumber, Description "
226 + "FROM legalnotices;");
228 notices
.add(rs
.getInt("id"));
229 notices
.add(rs
.getString("ReferenceNumber"));
230 notices
.add(rs
.getString("Description"));
234 } catch (SQLException ex
) {
235 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
240 static java
.util
.Date
getValidDate (ResultSet rs
, String datefield
) throws SQLException
{
241 // Since resultset.getDate returns a java.sql.Date, we need a way to get
242 // the date in java.util.Date which is usable in our application. Hence
243 // this helper function. Since we don't want a valid Date object if the
244 // field is null, we are using this if clause
245 if (rs
.getDate(datefield
) == null)
248 return (new java
.util
.Date(rs
.getLong(datefield
)*1000));
251 static ArrayList
<Object
> getNoticeDetails(int selid
) {
252 ArrayList
<Object
> notice
= new ArrayList
<>();
254 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
255 PreparedStatement st
= conn
.prepareStatement("SELECT legalnotices.*, clients.ClientName "
256 + "FROM legalnotices "
257 + "INNER JOIN clients WHERE ClientId=clients.id AND legalnotices.id=?;");
259 ResultSet rs
= st
.executeQuery();
261 notice
.add(rs
.getString("ReferenceNumber"));
262 notice
.add(rs
.getString("Description"));
263 notice
.add(getValidDate(rs
, "EntrustmentDate"));
264 notice
.add (rs
.getInt ("ClientId"));
265 notice
.add (rs
.getBoolean("DraftCreated"));
266 notice
.add (rs
.getBoolean("DraftApproved"));
267 notice
.add (rs
.getBoolean("NoticeSent"));
268 notice
.add (getValidDate(rs
, "SentDate"));
269 notice
.add (rs
.getString("RPADReference"));
270 notice
.add (rs
.getBoolean("NoticeDelivered"));
271 notice
.add (getValidDate(rs
, "DeliveryDate"));
272 notice
.add (rs
.getString("BillStatus"));
273 notice
.add (rs
.getInt ("BillAmount"));
274 notice
.add (getValidDate (rs
, "BillDate"));
275 notice
.add (rs
.getBoolean ("ClarificationPending"));
276 notice
.add (rs
.getString("ClarificationRemarks"));
277 notice
.add (rs
.getString("ClientName"));
280 } catch (SQLException ex
) {
281 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
287 private static final String JDBC
= "jdbc:sqlite:";
289 static boolean updateNoticeDraftStatus(int selectednotice_id
, boolean created
, boolean approved
) {
291 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
292 PreparedStatement st
= conn
.prepareStatement("UPDATE legalnotices "
293 + "SET DraftCreated=?, DraftApproved=? WHERE id=?;");
294 st
.setBoolean(1, created
);
295 st
.setBoolean(2, approved
);
296 st
.setInt (3, selectednotice_id
);
300 } catch (SQLException ex
) {
301 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
307 static boolean updateNoticeDescription(int selectednotice_id
, String text
) {
309 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
310 PreparedStatement st
= conn
.prepareStatement("UPDATE legalnotices "
311 + "SET Description=? WHERE id=?;");
312 st
.setString(1, text
);
313 st
.setInt(2, selectednotice_id
);
317 } catch (SQLException ex
) {
318 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
324 static boolean updateNoticeDispatchDetails(int selid
, boolean notice_sent
,
325 java
.util
.Date sent_date
, String rpad_reference
,
326 boolean notice_delivered
, java
.util
.Date delivery_date
) {
328 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
329 PreparedStatement st
= conn
.prepareStatement("UPDATE legalnotices"
330 + " SET NoticeSent=?, SentDate=?, RPADReference=?,"
331 + " NoticeDelivered=?, DeliveryDate=? WHERE id=?;");
333 st
.setBoolean(1, notice_sent
);
334 st
.setDate(2, toSqlDate(sent_date
));
335 st
.setString(3, rpad_reference
);
336 st
.setBoolean(4, notice_delivered
);
337 st
.setDate(5, toSqlDate(delivery_date
));
338 st
.setInt (6, selid
);
342 } catch (SQLException ex
) {
343 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
349 private static Date
toSqlDate(java
.util
.Date date
) {
352 Date sqldate
= new Date (date
.getTime()/1000);
356 static boolean updateNoticeBillDetails(int selid
, String bill_status
,
357 java
.util
.Date bill_date
, int bill_amount
) {
359 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
360 PreparedStatement st
= conn
.prepareStatement("UPDATE legalnotices"
361 + " SET BillStatus=?,BillDate=?,BillAmount=? WHERE id=?;");
362 st
.setString (1, bill_status
);
363 st
.setDate(2, toSqlDate(bill_date
));
364 st
.setInt(3, bill_amount
);
369 } catch (SQLException ex
) {
370 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
376 static boolean createDatabase(String db_path
) {
377 saveConnectionURL(db_path
);
378 String tblClients
= "CREATE TABLE IF NOT EXISTS \"clients\" (\n" +
379 " \"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
380 " \"ClientName\" VARCHAR(255) NOT NULL UNIQUE,\n" +
381 " \"ClientAddress\" TEXT,\n" +
382 " \"ContactPerson\" TEXT,\n" +
383 " \"MailID\" VARCHAR(255),\n" +
384 " \"ContactNumber\" VARCHAR(30)\n" +
386 String tblNotices
= "CREATE TABLE IF NOT EXISTS \"legalnotices\" (\n" +
387 " \"id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n" +
388 " \"ReferenceNumber\" TEXT NOT NULL UNIQUE,\n" +
389 " \"Description\" TEXT NOT NULL,\n" +
390 " \"EntrustmentDate\" INTEGER NOT NULL,\n" +
391 " \"ClientId\" INTEGER,\n" +
392 " \"DraftCreated\" INTEGER DEFAULT 0,\n" +
393 " \"DraftApproved\" INTEGER DEFAULT 0 CHECK(DraftApproved<=DraftCreated),\n" +
394 " \"NoticeSent\" INTEGER DEFAULT 0 CHECK(NoticeSent<=DraftApproved),\n" +
395 " \"SentDate\" INTEGER CHECK(SentDate>=EntrustmentDate),\n" +
396 " \"RPADReference\" TEXT,\n" +
397 " \"NoticeDelivered\" INTEGER DEFAULT 0 CHECK(NoticeDelivered<=NoticeSent),\n" +
398 " \"DeliveryDate\" INTEGER CHECK(DeliveryDate>=SentDate),\n" +
399 " \"BillStatus\" TEXT DEFAULT 'PENDING',\n" +
400 " \"BillAmount\" INTEGER DEFAULT 1000 CHECK(BillAmount>0),\n" +
401 " \"BillDate\" INTEGER CHECK(BillDate>=DeliveryDate),\n" +
402 " \"ClarificationPending\" INTEGER DEFAULT 0,\n" +
403 " \"ClarificationRemarks\" TEXT\n" +
407 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
408 Statement st1
= conn
.createStatement();
409 st1
.execute(tblClients
);
410 st1
.execute(tblNotices
);
413 } catch (SQLException ex
) {
414 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
420 static boolean updateNoticeClarificationDetails(int selected_id
, boolean
421 clarification_pending
, String clarification_remarks
) {
423 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
424 PreparedStatement st
= conn
.prepareStatement ("UPDATE legalnotices"
425 + " SET ClarificationPending=?, ClarificationRemarks=? "
427 st
.setBoolean(1, clarification_pending
);
428 st
.setString(2, clarification_remarks
);
429 st
.setInt (3, selected_id
);
433 } catch (SQLException ex
) {
434 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
440 static boolean deleteNotice(int r
) {
442 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
443 PreparedStatement st
= conn
.prepareStatement("DELETE FROM legalnotices"
449 } catch (SQLException ex
) {
450 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
456 static ArrayList
<Object
> getRaisedBills (int client_id
) {
458 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
459 PreparedStatement st
= conn
.prepareStatement("SELECT ReferenceNumber, "
460 + "Description, BillDate, BillAmount"
461 + " FROM legalnotices WHERE BillStatus='RAISED' AND ClientId=?;");
462 st
.setInt (1, client_id
);
464 ResultSet rs
= st
.executeQuery ();
465 ArrayList
<Object
> bills
= new ArrayList
<>();
467 bills
.add (rs
.getString("ReferenceNumber"));
468 bills
.add (rs
.getString("Description"));
469 bills
.add (getValidDate(rs
, "BillDate"));
470 bills
.add (rs
.getInt("BillAmount"));
475 } catch (SQLException ex
) {
476 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
482 static boolean generateRaisedNoticesBill(String fileName
, String clientName
,
483 String clientAddress
, String contactPerson
, ArrayList
<Object
> bills
) {
487 InputStream templ
= Utility
.class.getClassLoader().getResourceAsStream("resources/noticebill.template.fodt");
490 DateFormat fmt
= new SimpleDateFormat("dd MMM yyyy");
491 String templateMain
= new String (templ
.readAllBytes());
492 // this is for openoffice ODT - replace normal line breaks with the XML equivalent
493 String left
= leftLetterHeader
.replaceAll("\n", "<text:line-break/>");
494 String right
= rightLetterHeader
.replaceAll("\n", "<text:line-break/>");
495 String client_address
= clientAddress
.replaceAll ("\n", "<text:line-break/>");
496 String rows
= generateBillRows (bills
);
497 System
.out
.println (rows
);
499 String strMain
= MessageFormat
.format(templateMain
,
501 fmt
.format(new Date(System
.currentTimeMillis())),
502 clientName
, client_address
, contactPerson
, signatoryName
, rows
);
504 FileOutputStream f
= new FileOutputStream (fileName
);
505 f
.write (strMain
.getBytes());
508 } catch (IOException ex
) {
509 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
514 private static String
generateBillRows(ArrayList
<Object
> bills
) {
516 InputStream tmpl
= Utility
.class.getClassLoader().getResourceAsStream("resources/tablerow.template.xml");
517 String rowtpl
= new String(tmpl
.readAllBytes());
519 DateFormat fmt
= new SimpleDateFormat("dd/MM/yyyy");
521 StringBuilder bldr
= new StringBuilder ();
522 for (int i
= 0; i
< bills
.size(); i
+= 4) {
523 String row
= MessageFormat
.format (rowtpl
, (String
)bills
.get(i
),
524 (String
)bills
.get(i
+1), fmt
.format((java
.util
.Date
)bills
.get(i
+2)),
525 (int)bills
.get(i
+3));
528 return (bldr
.toString());
529 } catch (IOException ex
) {
530 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
535 static boolean updateNoticeBillStatus(int client_id
, String from_status
,
538 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
539 PreparedStatement st
= conn
.prepareStatement("UPDATE legalnotices"
540 + " SET BillStatus=? WHERE BillStatus=? AND ClientId=?;");
541 st
.setString (1, to_status
);
542 st
.setString (2, from_status
);
543 st
.setInt (3, client_id
);
547 } catch (SQLException ex
) {
548 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
554 static ArrayList
<Object
> getReportData(int report_num
, int clientid
) {
555 ArrayList
<Object
> data
= new ArrayList
<>();
557 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
559 // if no client ID is specified i.e. -1 get ll
561 if (clientid
== -1) {
562 Statement st
= conn
.createStatement();
563 rs
= st
.executeQuery(REPORTS_UNFILTERED
[report_num
]);
566 PreparedStatement st
= conn
.prepareStatement(REPORTS_FILTERED
[report_num
]);
567 st
.setInt (1, clientid
);
568 rs
= st
.executeQuery();
572 ResultSetMetaData md
= rs
.getMetaData();
573 SimpleDateFormat fmt
= new SimpleDateFormat ("dd MMM yyyy");
574 for (int i
= 1; i
<= md
.getColumnCount(); i
++ ) {
575 // for INTEGER Columns which are date alone, handle separately
576 if (md
.getColumnName(i
).contains("Date"))
577 data
.add (fmt
.format(getValidDate(rs
, md
.getColumnName(i
))));
579 data
.add (rs
.getObject (i
));
584 } catch (SQLException ex
) {
585 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
591 static boolean saveReportCSV(String filePath
, String
[] reportCols
, ArrayList
<Object
> reportData
) {
593 FileWriter f
= new FileWriter (filePath
);
594 for (int i
= 0; i
< reportCols
.length
; i
++) {
595 f
.append (escapeQuote(reportCols
[i
]));
599 for (int i
= 0; i
< reportData
.size(); i
+= reportCols
.length
) {
600 for (int j
= 0; j
< reportCols
.length
; j
++) {
601 f
.append (escapeQuote(reportData
.get(i
+j
)));
609 } catch (IOException ex
) {
610 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
616 private static String
escapeQuote(Object bareStr
) {
617 if (bareStr
.getClass() == String
.class) {
618 String str
= (String
)bareStr
;
619 String escapedStr
= str
.replace ("\"", "\"\"");
620 System
.out
.println(escapedStr
);
621 String finalStr
= String
.format ("\"%s\"", escapedStr
);
625 return String
.format("\"%s\"", bareStr
.toString());
632 public static String connectionURL
;
633 public static String leftLetterHeader
;
634 public static String rightLetterHeader
;
635 public static String signatoryName
;
641 public static ArrayList
<Object
> getClientsNameAndId () {
642 ArrayList
<Object
> data
= new ArrayList
<>();
644 Connection conn
= DriverManager
.getConnection(JDBC
+ connectionURL
);
645 Statement st
= conn
.createStatement();
646 ResultSet rs
= st
.executeQuery("SELECT id, ClientName from clients;");
648 data
.add(rs
.getInt("id"));
649 data
.add(rs
.getString("ClientName"));
653 } catch (SQLException ex
) {
654 Logger
.getLogger(Utility
.class.getName()).log(Level
.SEVERE
, null, ex
);
660 public static void retrieveConnectionURL () {
661 Preferences myPrefs
= Preferences
.userRoot().node("org/harishankar/Habeas");
662 connectionURL
= myPrefs
.get("ConnectionURL", "legaldb");