Revision 1142
Added by Jing Tao over 22 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
105 | 105 |
|
106 | 106 |
private ServletConfig config = null; |
107 | 107 |
private ServletContext context = null; |
108 |
//private Hashtable connectionPool = new Hashtable(); |
|
108 | 109 |
private String resultStyleURL = null; |
109 | 110 |
private String xmlcatalogfile = null; |
110 | 111 |
private String saxparser = null; |
... | ... | |
114 | 115 |
private String htmlpath = null; |
115 | 116 |
private PropertyResourceBundle options = null; |
116 | 117 |
private MetaCatUtil util = null; |
117 |
private DBConnectionPool connPool = null; |
|
118 | 118 |
|
119 | 119 |
/** |
120 | 120 |
* Initialize the servlet by creating appropriate database connections |
... | ... | |
127 | 127 |
System.out.println("MetaCatServlet Initialize"); |
128 | 128 |
|
129 | 129 |
util = new MetaCatUtil(); |
130 |
|
|
131 |
//initial DBConnection pool |
|
132 |
connPool = DBConnectionPool.getInstance(); |
|
133 | 130 |
|
134 | 131 |
// Get the configuration file information |
135 | 132 |
resultStyleURL = util.getOption("resultStyleURL"); |
... | ... | |
140 | 137 |
servletpath = util.getOption("servletpath"); |
141 | 138 |
htmlpath = util.getOption("htmlpath"); |
142 | 139 |
|
143 |
|
|
140 |
// MOVED IT TO doGet() & doPost() |
|
141 |
// try { |
|
142 |
// // Open a pool of db connections |
|
143 |
// connectionPool = util.getConnectionPool(); |
|
144 |
// } catch (Exception e) { |
|
145 |
// System.err.println("Error creating pool of database connections"); |
|
146 |
// System.err.println(e.getMessage()); |
|
147 |
// } |
|
144 | 148 |
} catch ( ServletException ex ) { |
145 | 149 |
throw ex; |
146 |
} catch (SQLException e) { |
|
147 |
MetaCatUtil.debugMessage("Error in MetacatServlet.init: " |
|
148 |
+e.getMessage(), 20); |
|
149 | 150 |
} |
150 | 151 |
} |
151 | 152 |
|
... | ... | |
157 | 158 |
if (util != null) { |
158 | 159 |
util.closeConnections(); |
159 | 160 |
} |
160 |
connPool.release(); |
|
161 | 161 |
} |
162 | 162 |
|
163 | 163 |
/** Handle "GET" method requests from HTTP clients */ |
... | ... | |
1389 | 1389 |
|
1390 | 1390 |
// get connection from the pool |
1391 | 1391 |
conn = util.getConnection(); |
1392 |
AccessControlList aclobj = new AccessControlList(); |
|
1392 |
AccessControlList aclobj = new AccessControlList(conn);
|
|
1393 | 1393 |
String acltext = aclobj.getACL(docid, username, groupnames); |
1394 | 1394 |
out.println(acltext); |
1395 | 1395 |
|
Also available in: Unified diff
Change back to Connection. DBConnection will store in cvs branch..