View Javadoc
1 /*** 2 * Copyright (c) 2002, Reuters America Inc. All rights reserved.<p> 3 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following 4 * conditions are met:<p> 5 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer 7 * in the documentation and/or other materials provided with the distribution. Neither the name of Reuters America Inc. nor the 8 * names of its contributors may be used to endorse or promote products derived from this software without specific prior written 9 * permission.<p> 10 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 11 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 12 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 13 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 14 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 15 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<p> 16 */ 17 18 package com.reuters.rc.db; 19 20 import com.tibco.tibrv.*; 21 22 /*** 23 * The DB reply interface that abstracts out a clients interaction with 24 * any ADB-like server. 25 * 26 * @author Jawaid Hakim 27 * @author Cavit Aydin (converted to an interface) 28 */ 29 public interface DbReply 30 { 31 32 /*** 33 * Check if the object contains a valid result set. 34 * @return <code>true</code> if the object contains a valid 35 * result set. Returns <code>false</code> if the object does 36 * not contain a valid result set. 37 * @see #getStatus() 38 */ 39 public boolean isValid(); 40 41 42 /*** 43 * Pretty Print the reply message. 44 * @return Pretty Printed value. 45 */ 46 public String toPrettyPrintString() throws DbBusinessException, DbSystemException; 47 48 49 /*** 50 * Get the reply status. 51 * @return Reply status. <code>0</code> indicates success. A non-zero status 52 * indicates ADB error. 53 * @see #getError() 54 */ 55 public int getStatus() throws DbBusinessException, DbSystemException; 56 57 58 /*** 59 * Get the sql that caused the error. 60 * @return Sql statement that caused the error. <code>null</code> is 61 * returned if there is no error. 62 * @see #getStatus() 63 * @see #isValid() 64 * @see #getError() 65 */ 66 public String getSql() throws DbBusinessException, DbSystemException; 67 68 69 /*** 70 * Get a description of the error. 71 * @return Description of error. 72 * @see #getStatus() 73 * @see #getSql() 74 */ 75 public String getError() throws DbBusinessException, DbSystemException; 76 77 78 /*** 79 * Get the closure argument. 80 * @return Closure argument. <code>TibrvException</code> is thrown if 81 * there is no closure. 82 */ 83 public Object getClosure() throws DbBusinessException, DbSystemException; 84 85 86 /*** 87 * Get the number of result sets. 88 * @return Number of result sets. 89 */ 90 public int getResultSetCount() throws DbBusinessException, DbSystemException; 91 92 /*** 93 * Get the number of rows in the first result set. 94 * @return Number of rows in the first set. 95 * @see #getResultSetCount() 96 */ 97 public int getResultRowCount() throws DbBusinessException, DbSystemException; 98 99 100 101 /*** 102 * Get the number of rows in the specified result set. 103 * @param resultSet Result set number starting at <code>1</code>. 104 * @return Number of rows in the specified set. 105 * @see #getResultSetCount() 106 */ 107 public int getResultRowCount(int resultSet) throws DbBusinessException, DbSystemException; 108 109 110 /*** 111 * Get a row from the first result set. 112 * @param index Result set row number. Row numbers start at <code>0</code>. 113 * @return Requested result row from the first result set. <code>null</code> is 114 * returned if the requested row is not found in the first result set. 115 * @see com.tibco.tibrv.TibrvMsg 116 */ 117 public TibrvMsg getResultRow(int index) throws DbBusinessException, DbSystemException; 118 119 120 /*** 121 * Get a row from the specified result set. Result set numbers start at <code>1</code>. 122 * @param resultSet Result set number. Result set numbers start at <code>1</code>. 123 * @param index Result set row number. Row numbers start at <code>0</code>. 124 * @return Requested result row from the first result set. <code>null</code> is 125 * returned if the requested row is not found in the specified result set. 126 * @see #getResultSetCount() 127 * @see com.tibco.tibrv.TibrvMsg 128 */ 129 public TibrvMsg getResultRow(int resultSet, int index) throws DbBusinessException, DbSystemException; 130 131 132 }

This page was automatically generated by Maven