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

📄 dbconnectionmanager.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../org/jivesoftware/database/SchemaManager.html" title="class in org.jivesoftware.database">SchemaManager</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#getSchemaManager()">getSchemaManager</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a SchemaManager instance, which can be used to manage the database schema information for Openfire and plugins.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#getTestSQL(java.lang.String)">getTestSQL</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;driver)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#getTransactionConnection()">getTransactionConnection</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a Connection from the currently active connection provider that is ready to participate in transactions (auto commit is set to false).</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isBatchUpdatesSupported()">isBatchUpdatesSupported</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isEmbeddedDB()">isEmbeddedDB</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isFetchSizeSupported()">isFetchSizeSupported</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isMaxRowsSupported()">isMaxRowsSupported</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isProfilingEnabled()">isProfilingEnabled</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if connection profiling is turned on.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isScrollResultsSupported()">isScrollResultsSupported</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isStreamTextRequired()">isStreamTextRequired</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isSubqueriesSupported()">isSubqueriesSupported</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#isTransactionsSupported()">isTransactionsSupported</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#scrollResultSet(java.sql.ResultSet, int)">scrollResultSet</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html" title="class or interface in java.sql">ResultSet</A>&nbsp;rs,                int&nbsp;rowNumber)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scrolls forward in a result set the specified number of rows.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#setConnectionProvider(org.jivesoftware.database.ConnectionProvider)">setConnectionProvider</A></B>(<A HREF="../../../org/jivesoftware/database/ConnectionProvider.html" title="interface in org.jivesoftware.database">ConnectionProvider</A>&nbsp;provider)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the connection provider.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#setFetchSize(java.sql.ResultSet, int)">setFetchSize</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html" title="class or interface in java.sql">ResultSet</A>&nbsp;rs,             int&nbsp;fetchSize)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of rows that the JDBC driver should buffer at a time.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#setLargeTextField(java.sql.PreparedStatement, int, java.lang.String)">setLargeTextField</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/PreparedStatement.html" title="class or interface in java.sql">PreparedStatement</A>&nbsp;pstmt,                  int&nbsp;parameterIndex,                  <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a large text column in a result set, automatically performing streaming if the JDBC driver requires it.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#setMaxRows(java.sql.Statement, int)">setMaxRows</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Statement.html" title="class or interface in java.sql">Statement</A>&nbsp;stmt,           int&nbsp;maxRows)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the max number of rows that should be returned from executing a statement.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/database/DbConnectionManager.html#setProfilingEnabled(boolean)">setProfilingEnabled</A></B>(boolean&nbsp;enable)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Turns connection profiling on or off.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getConnection()"><!-- --></A><H3>getConnection</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A> <B>getConnection</B>()                                throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></PRE><DL><DD>Returns a database connection from the currently active connection provider. An exception will be thrown if no connection was found. (auto commit is set to true).<P><DD><DL><DT><B>Returns:</B><DD>a connection.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></CODE> - if a SQL exception occurs or no connection was found.</DL></DD></DL><HR><A NAME="getTransactionConnection()"><!-- --></A><H3>getTransactionConnection</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A> <B>getTransactionConnection</B>()                                           throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></PRE><DL><DD>Returns a Connection from the currently active connection provider that is ready to participate in transactions (auto commit is set to false).<P><DD><DL><DT><B>Returns:</B><DD>a connection with transactions enabled.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/SQLException.html" title="class or interface in java.sql">SQLException</A></CODE> - if a SQL exception occurs.</DL></DD></DL><HR><A NAME="closeTransactionConnection(java.sql.PreparedStatement, java.sql.Connection, boolean)"><!-- --></A><H3>closeTransactionConnection</H3><PRE>public static void <B>closeTransactionConnection</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/PreparedStatement.html" title="class or interface in java.sql">PreparedStatement</A>&nbsp;pstmt,                                              <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A>&nbsp;con,                                              boolean&nbsp;abortTransaction)</PRE><DL><DD>Closes a PreparedStatement and Connection. However, it first rolls back the transaction or commits it depending on the value of <code>abortTransaction</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>pstmt</CODE> - the prepared statement to close.<DD><CODE>con</CODE> - the connection to close.<DD><CODE>abortTransaction</CODE> - true if the transaction should be rolled back.</DL></DD></DL><HR><A NAME="closeTransactionConnection(java.sql.Connection, boolean)"><!-- --></A><H3>closeTransactionConnection</H3><PRE>public static void <B>closeTransactionConnection</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html" title="class or interface in java.sql">Connection</A>&nbsp;con,                                              boolean&nbsp;abortTransaction)</PRE><DL><DD>Closes a Connection. However, it first rolls back the transaction or commits it depending on the value of <code>abortTransaction</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>con</CODE> - the connection to close.<DD><CODE>abortTransaction</CODE> - true if the transaction should be rolled back.</DL></DD></DL><HR><A NAME="closeResultSet(java.sql.ResultSet)"><!-- --></A><H3>closeResultSet</H3><PRE>public static void <B>closeResultSet</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html" title="class or interface in java.sql">ResultSet</A>&nbsp;rs)</PRE><DL><DD>Closes a result set. This method should be called within the finally section of your database logic, as in the following example: <pre>  public void doSomething(Connection con) {      ResultSet rs = null;      PreparedStatement pstmt = null;      try {          pstmt = con.prepareStatement("select * from blah");          rs = pstmt.executeQuery();          ....      }      catch (SQLException sqle) {          Log.error(sqle);      }      finally {          ConnectionManager.closeResultSet(rs);          ConnectionManager.closePreparedStatement(pstmt);      }

⌨️ 快捷键说明

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