KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > quercus > lib > db > PostgresResult


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Rodrigo Westrupp
28  */

29
30 package com.caucho.quercus.lib.db;
31
32 import com.caucho.util.L10N;
33
34 import java.sql.ResultSet JavaDoc;
35 import java.sql.ResultSetMetaData JavaDoc;
36 import java.sql.Statement JavaDoc;
37 import java.util.logging.Logger JavaDoc;
38
39 /**
40  * postgres result set class (postgres has NO object oriented API)
41  */

42 public class PostgresResult extends JdbcResultResource {
43   private static final Logger JavaDoc log
44     = Logger.getLogger(PostgresResult.class.getName());
45   private static final L10N L = new L10N(PostgresResult.class);
46
47   // See PostgresModule.pg_fetch_array()
48
private boolean _passedNullRow = false;
49
50   /**
51    * Constructor for PostgresResult
52    *
53    * @param stmt the corresponding statement
54    * @param rs the corresponding result set
55    * @param conn the corresponding connection
56    */

57   public PostgresResult(Statement JavaDoc stmt,
58                         ResultSet JavaDoc rs,
59                         Postgres conn)
60   {
61     super(stmt, rs, conn);
62   }
63
64   /**
65    * Constructor for PostgresResult
66    *
67    * @param metaData the corresponding result set meta data
68    * @param conn the corresponding connection
69    */

70   public PostgresResult(ResultSetMetaData JavaDoc metaData,
71                         Postgres conn)
72   {
73     super(metaData, conn);
74   }
75
76   /**
77    * Sets that a NULL row parameter has been passed in.
78    */

79   public void setPassedNullRow()
80   {
81     // After that, the flag is immutable.
82
// See PostgresModule.pg_fetch_array
83

84     _passedNullRow = true;
85   }
86
87   /**
88    * Returns whether a NULL row parameter has been
89    * passed in or not.
90    */

91   public boolean getPassedNullRow()
92   {
93     // After that, the flag is immutable.
94
// See PostgresModule.pg_fetch_array
95

96     return _passedNullRow;
97   }
98
99   /**
100    * Returns a string representation for this object.
101    *
102    * @return a string representation for this object
103    */

104   public String JavaDoc toString()
105   {
106     if (!_closed)
107       return "PostgresResult[" + super.toString() + "]";
108     else
109       return "PostgresResult[closed]";
110   }
111 }
112
Popular Tags