Mercurial > hg > digilib-old
comparison servlet/src/digilib/auth/dlDataModule.java @ 1:0ff3ede32060
Initial revision
author | robcast |
---|---|
date | Thu, 17 Jan 2002 15:25:46 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:ffd2df307e81 | 1:0ff3ede32060 |
---|---|
1 /* dlDataModule -- Database access helper class | |
2 | |
3 Digital Image Library servlet components | |
4 | |
5 Copyright (C) 2001, 2002 Robert Casties (robcast@mail.berlios.de) | |
6 | |
7 This program is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 2 of the License, or (at your | |
10 option) any later version. | |
11 | |
12 Please read license.txt for the full details. A copy of the GPL | |
13 may be found at http://www.gnu.org/copyleft/lgpl.html | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, write to the Free Software | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 */ | |
20 | |
21 package digilib.auth; | |
22 | |
23 import com.borland.dx.dataset.*; | |
24 import com.borland.dx.sql.dataset.*; | |
25 | |
26 | |
27 public class dlDataModule implements DataModule { | |
28 private static dlDataModule myDM; | |
29 Database dlDatabase = new Database(); | |
30 QueryDataSet authPathsQuery = new QueryDataSet(); | |
31 | |
32 public dlDataModule() { | |
33 try { | |
34 jbInit(); | |
35 } | |
36 catch(Exception e) { | |
37 e.printStackTrace(); | |
38 } | |
39 } | |
40 private void jbInit() throws Exception { | |
41 authPathsQuery.setReadOnly(true); | |
42 authPathsQuery.setEditable(false); | |
43 authPathsQuery.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(dlDatabase, "select * from digilib_paths", null, true, Load.ALL)); | |
44 dlDatabase.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:oracle:thin:@penelope.unibe.ch:1521:WTWG", "digilib_auth", "allesmainz", false, "oracle.jdbc.driver.OracleDriver")); | |
45 } | |
46 public static dlDataModule getDataModule() { | |
47 if (myDM == null) { | |
48 myDM = new dlDataModule(); | |
49 } | |
50 return myDM; | |
51 } | |
52 public com.borland.dx.sql.dataset.Database getDlDatabase() { | |
53 return dlDatabase; | |
54 } | |
55 public com.borland.dx.sql.dataset.QueryDataSet getAuthPathsQuery() { | |
56 return authPathsQuery; | |
57 } | |
58 } |