📄 dbmanager.html
字号:
<B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="singleton()"><!-- --></A><H3>singleton</H3><PRE>public static <A HREF="../../javatools/db/DbManager.html">DbManager</A> <B>singleton</B>()</PRE><DL><DD>Return THE DbManager.<P><DD><DL><DT><B>Returns:</B><DD>The manager itself.</DL></DD></DL><HR><A NAME="getNameDatabaseMap()"><!-- --></A><H3>getNameDatabaseMap</H3><PRE>public java.util.Map <B>getNameDatabaseMap</B>()</PRE><DL><DD>Return a Map that maps names to DbDatabases.<P><DD><DL><DT><B>Returns:</B><DD>The nameDatabaseMap value</DL></DD></DL><HR><A NAME="getDatabaseNameMap()"><!-- --></A><H3>getDatabaseNameMap</H3><PRE>public java.util.Map <B>getDatabaseNameMap</B>()</PRE><DL><DD>Return a Map that maps DbDatabases to names.<P><DD><DL><DT><B>Returns:</B><DD>The databaseNameMap value</DL></DD></DL><HR><A NAME="getProps()"><!-- --></A><H3>getProps</H3><PRE>public <A HREF="../../javatools/util/Props.html">Props</A> <B>getProps</B>() throws java.io.IOException</PRE><DL><DD>Return a properties object for the db subsystem. Currently we always use a "db.properties" that is found on the classpath.<P><DD><DL><DT><B>Returns:</B><DD>The props value<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - If something goes wrong in loading properties file.</DL></DD></DL><HR><A NAME="getDatabase(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>getDatabase</H3><PRE>public <A HREF="../../javatools/db/DbDatabase.html">DbDatabase</A> <B>getDatabase</B>(java.lang.String name, java.lang.String driver, java.lang.String connectString, java.lang.String userName, java.lang.String password) throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Return the database object associated with this name or parameters. If you don't give a name DbManager won't be able to cache DbDatabase objects, so giving a name is recommended. Usually the name will be just something which identifies this application. Once a DbDatabase is in the cache you can use the getDatabase(name) with one argument. Alternatively you can always use the one argument version and the parameters will come from the db.properties file.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - An arbitrary name used to identify this DbDatabase.<DD><CODE>driver</CODE> - The Java JDBC driver class name.<DD><CODE>connectString</CODE> - The JDBC connect string.<DD><CODE>userName</CODE> - The database connect user name.<DD><CODE>password</CODE> - The database connect password.<DT><B>Returns:</B><DD>The database value<DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - If something goes wrong.</DL></DD></DL><HR><A NAME="getDatabase(java.lang.String)"><!-- --></A><H3>getDatabase</H3><PRE>public <A HREF="../../javatools/db/DbDatabase.html">DbDatabase</A> <B>getDatabase</B>(java.lang.String name) throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Return the database associated with this name. If the database is already in the cache we return that, otherwise we attempt to read a db properties file and get a connect configuration from that with <name>.<property> . For example, you could have a notional database called "foo". Then in your db.properties file you might have a setup like: <PRE> foo.driver = oracle.jdbc.driver.OracleDriver foo.connect = jdbc:oracle:thin:@dbdev01:1521:devu02 foo.userId = foouserid foo.password = foopassword </PRE> In terms of where the db.properties file will be located, that is determined by the javatools.util.Props class.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - The name in the cache and/or in the db.properties file.<DT><B>Returns:</B><DD>The database value<DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - If something goes wrong.<DT><B>See Also:</B><DD><A HREF="../../javatools/util/Props.html"><CODE>Props</CODE></A></DL></DD></DL><HR><A NAME="commitClose()"><!-- --></A><H3>commitClose</H3><PRE>public void <B>commitClose</B>() throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Commit and close ALL connections associated with this database.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - If something goes wrong.</DL></DD></DL><HR><A NAME="rollbackClose()"><!-- --></A><H3>rollbackClose</H3><PRE>public void <B>rollbackClose</B>() throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Rollback and close ALL connections associated with this database.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - If something goes wrong.</DL></DD></DL><HR><A NAME="commit()"><!-- --></A><H3>commit</H3><PRE>public void <B>commit</B>() throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Perform a commit on ALL connections associated with this database.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - If something goes wrong.</DL></DD></DL><HR><A NAME="rollback()"><!-- --></A><H3>rollback</H3><PRE>public void <B>rollback</B>() throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Perform a rollback on ALL connections associated with this database.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - If something goes wrong.</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>() throws <A HREF="../../javatools/db/DbException.html">DbException</A></PRE><DL><DD>Close ALL connections associated with this database.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../javatools/db/DbException.html">DbException</A></CODE> - Description of Exception</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javatools/db/DbLiteral.html"><B>PREV CLASS</B></A> <A HREF="../../javatools/db/DbMiscExpr.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="DbManager.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -