01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.cache.impl;
10:
11: import com.completex.objective.components.cache.Cache;
12:
13: import java.sql.Connection;
14: import java.sql.SQLException;
15: import java.sql.Statement;
16:
17: /**
18: * @see Cache
19: *
20: * @author Gennady Krizhevsky
21: */
22: public class NullPreparedStatementCache implements Cache {
23:
24: /**
25: * @see Cache#acquire(Object, Object)
26: */
27: public Object acquire(Object context, Object key)
28: throws SQLException {
29: return ((Connection) context).prepareStatement(((String) key));
30: }
31:
32: /**
33: * @see Cache#release(Object, Object)
34: */
35: public void release(Object context, Object res) throws SQLException {
36: ((Statement) res).close();
37: }
38: }
|