⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 norowsresultsetimpl.java

📁 derby database source code.good for you.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
	/**	 * Returns the row number of the current row.  Row	 * numbers start from 1 and go to 'n'.  Corresponds	 * to row numbering used to position current row	 * in the result set (as per JDBC).	 *	 * @return	the row number, or 0 if not on a row	 *	 */	public int getRowNumber()	{		return 0;	}	/**     * No rows to return, does nothing	 *	 * @exception StandardException thrown on error	 */	public void	close() throws StandardException	{ 		isClosed = true;	}	/**		Just report that it is always closed.		RESOLVE: if we don't report that we are closed,		then we will wind up with a dependency problem when		we send an invalidateFor on our own Statement.  It		will call lcc.verifyNoOpenResultSets(), which is really		supposed to be verify that there are no read only		result sets that are open.	 */	public boolean isClosed() {		return isClosed;		//return true;	}	/**	 *	doesn't need to do anything, as no calls	 *	are made that need to be restricted once	 *	the result set is 'finished'.	 *	 * @exception StandardException on error	 */	public void finish() throws StandardException {		if (! dumpedStats)		{			/*			** If run time statistics tracing is turned on, then now is the			** time to dump out the information.			** NOTE - We make a special exception for commit.  If autocommit			** is on, then the run time statistics from the autocommit is the			** only one that the user would ever see.  So, we don't overwrite			** the run time statistics object for a commit.			*/			if (lcc.getRunTimeStatisticsMode() &&				! doesCommit())			{				endExecutionTime = getCurrentTimeMillis();				ExecutionContext ec = lcc.getExecutionContext();				ResultSetStatisticsFactory rssf;				rssf = ec.getResultSetStatisticsFactory();				lcc.setRunTimeStatisticsObject(					rssf.getRunTimeStatistics(activation, this, subqueryTrackingArray));				HeaderPrintWriter istream = lcc.getLogQueryPlan() ? Monitor.getStream() : null;				if (istream != null)				{					istream.printlnWithHeader(LanguageConnectionContext.xidStr + 											  lcc.getTransactionExecute().getTransactionIdString() +											  "), " +											  LanguageConnectionContext.lccStr +											  lcc.getInstanceNumber() +											  "), " +											  lcc.getRunTimeStatisticsObject().getStatementText() + " ******* " +											  lcc.getRunTimeStatisticsObject().getStatementExecutionPlanText());				}			}			dumpedStats = true;		}		/* This is the top ResultSet, 		 * close all of the open subqueries.		 */		int staLength = (subqueryTrackingArray == null) ? 0 :							subqueryTrackingArray.length;		for (int index = 0; index < staLength; index++)		{			if (subqueryTrackingArray[index] == null)			{				continue;			}			if (subqueryTrackingArray[index].isClosed())			{				continue;			}			subqueryTrackingArray[index].close();		}	}	/**	 * Get the execution time in milliseconds.	 *	 * @return long		The execution time in milliseconds.	 */	public long getExecuteTime()	{		return endTime - beginTime;	}	/**	 * Get the Timestamp for the beginning of execution.	 *	 * @return Timestamp		The Timestamp for the beginning of execution.	 */	public Timestamp getBeginExecutionTimestamp()	{		if (beginExecutionTime == 0)		{			return null;		}		else		{			return new Timestamp(beginExecutionTime);		}	}	/**	 * Get the Timestamp for the end of execution.	 *	 * @return Timestamp		The Timestamp for the end of execution.	 */	public Timestamp getEndExecutionTimestamp()	{		if (endExecutionTime == 0)		{			return null;		}		else		{			return new Timestamp(endExecutionTime);		}	}	/**	 * RESOLVE - This method will go away once it is overloaded in all subclasses.	 * Return the query plan as a String.	 *	 * @param depth	Indentation level.	 *	 * @return String	The query plan as a String.	 */	public String getQueryPlanText(int depth)	{		return MessageService.getTextMessage(				SQLState.LANG_GQPT_NOT_SUPPORTED,				getClass().getName());	}	/**	 * Return the total amount of time spent in this ResultSet	 *	 * @param type	CURRENT_RESULTSET_ONLY - time spent only in this ResultSet	 *				ENTIRE_RESULTSET_TREE  - time spent in this ResultSet and below.	 *	 * @return long		The total amount of time spent (in milliseconds).	 */	public long getTimeSpent(int type)	{		/* RESOLVE - this should be overloaded in all subclasses */		return 0;	}	/**	 * @see ResultSet#getSubqueryTrackingArray	 */	public final NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)	{		if (subqueryTrackingArray == null)		{			subqueryTrackingArray = new NoPutResultSet[numSubqueries];		}		return subqueryTrackingArray;	}	/**	 * @see ResultSet#getAutoGeneratedKeysResultset	 */	public ResultSet getAutoGeneratedKeysResultset()	{		//A non-null resultset would be returned only for an insert statement 		return (ResultSet)null;	}	/**		Return the cursor name, null in this case.		@see ResultSet#getCursorName	*/	public String getCursorName() {		return null;	}	// class implementation	/**	 * Return the current time in milliseconds, if DEBUG and RunTimeStats is	 * on, else return 0.  (Only pay price of system call if need to.)	 *	 * @return long		Current time in milliseconds.	 */	protected final long getCurrentTimeMillis()	{		if (statisticsTimingOn)		{			return System.currentTimeMillis();		}		else		{			return 0;		}	}	/**	  *	Run a check constraint against the current row. Raise an error if	  * the check constraint is violated.	  *	  *	@param	checkGM			Generated code to run the check constraint.	  * @param	checkName		Name of the constraint to check.	  *	@param	heapConglom		Number of heap conglomerate.	  *	@param	Activation		Class in which checkGM lives.	  *	  * @exception StandardException thrown on error	  */	public	static	void	evaluateACheckConstraint	(	  GeneratedMethod checkGM,	  String checkName,	  long heapConglom,	  Activation activation	)		throws StandardException	{		if (checkGM != null)		{			DataValueDescriptor checkBoolean;			checkBoolean = (DataValueDescriptor) checkGM.invoke(activation);			/* Throw exception if check constraint is violated.			 * (Only if check constraint evaluates to false.)			 */ 			if ((checkBoolean != null) &&				(! checkBoolean.isNull()) &&				(! checkBoolean.getBoolean()))			{				/* Now we have a lot of painful work to get the				 * table name for the error message.  All we have 				 * is the conglomerate number to work with.				 */				DataDictionary dd = activation.getLanguageConnectionContext().getDataDictionary();				ConglomerateDescriptor cd = dd.getConglomerateDescriptor( heapConglom );				TableDescriptor td = dd.getTableDescriptor(cd.getTableID());				StandardException se = StandardException.newException(SQLState.LANG_CHECK_CONSTRAINT_VIOLATED, 					td.getQualifiedName(), checkName);				throw se;			}		}	}	/**	  *	Run check constraints against the current row. Raise an error if	  * a check constraint is violated.	  *	  *	@param	checkGM			Generated code to run the check constraint.	  *	@param	Activation		Class in which checkGM lives.	  *	  * @exception StandardException thrown on error	  */	public	static	void	evaluateCheckConstraints	(	  GeneratedMethod checkGM,	  Activation activation	)		throws StandardException	{		if (checkGM != null)		{			// Evaluate the expression containing the check constraints.			// This expression will throw an exception if there is a			// violation, so there is no need to check the result.			checkGM.invoke(activation);		}	}	  	/**	 * Does this ResultSet cause a commit or rollback.	 *	 * @return Whether or not this ResultSet cause a commit or rollback.	 */	public boolean doesCommit()	{		return false;	}	public java.sql.SQLWarning getWarnings() {		return null;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -