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

📄 drivermanager.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<PRE>public static <A HREF="../../java/io/PrintWriter.html">PrintWriter</A> <B>getLogWriter</B>()</PRE><DL><DD>Gets the log writer.   The <code>getLogWriter</code> and <code>setLogWriter</code>  methods should be used instead of the <code>get/setlogStream</code> methods, which are deprecated.<DD><DL><DT><B>Returns:</B><DD>a <code>java.io.PrintWriter</code> object<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><a href="package-summary.html#2.0 API">What Is in the JDBC      2.0 API</a></DL></DD></DL><HR><A NAME="setLogWriter(java.io.PrintWriter)"><!-- --></A><H3>setLogWriter</H3><PRE>public static void <B>setLogWriter</B>(<A HREF="../../java/io/PrintWriter.html">PrintWriter</A>&nbsp;out)</PRE><DL><DD>Sets the logging/tracing <code>PrintWriter</code> object that is used by the <code>DriverManager</code> and all drivers. <P> There is a minor versioning problem created by the introduction of the method </code>setLogWriter</code>.  The  method <code>setLogWriter</code> cannot create a <code>PrintStream</code> object that will be returned by <code>getLogStream</code>---the Java platform does not provide a backward conversion.  As a result, a new application that uses <code>setLogWriter</code> and also uses a JDBC 1.0 driver that uses <code>getLogStream</code> will likely not see debugging information written  by that driver.<P> In the Java 2 SDK, Standard Edition, version 1.3 release, this method checks to see that there is an <code>SQLPermission</code> object before setting the logging stream.  If a <code>SecurityManager</code> exists and its <code>checkPermission</code> method denies setting the log writer, this method throws a <code>java.lang.SecurityException</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>out</CODE> - the new logging/tracing <code>PrintStream</code> object;      <code>null</code> to disable logging and tracing<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its    <code>checkPermission</code> method denies    setting the log writer<DT><B>Since: </B><DD>1.2</DD><DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>SecurityManager.checkPermission(java.security.Permission)</CODE></A>, <a href="package-summary.html#2.0 API">What Is in the JDBC      2.0 API</a></DL></DD></DL><HR><A NAME="getConnection(java.lang.String, java.util.Properties)"><!-- --></A><H3>getConnection</H3><PRE>public static <A HREF="../../java/sql/Connection.html">Connection</A> <B>getConnection</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;url,                                       <A HREF="../../java/util/Properties.html">Properties</A>&nbsp;info)                                throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Attempts to establish a connection to the given database URL. The <code>DriverManager</code> attempts to select an appropriate driver from the set of registered JDBC drivers.<DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - a database url of the form  <code> jdbc:<em>subprotocol</em>:<em>subname</em></code><DD><CODE>info</CODE> - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included<DT><B>Returns:</B><DD>a Connection to the URL<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="getConnection(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>getConnection</H3><PRE>public static <A HREF="../../java/sql/Connection.html">Connection</A> <B>getConnection</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;url,                                       <A HREF="../../java/lang/String.html">String</A>&nbsp;user,                                       <A HREF="../../java/lang/String.html">String</A>&nbsp;password)                                throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Attempts to establish a connection to the given database URL. The <code>DriverManager</code> attempts to select an appropriate driver from the set of registered JDBC drivers.<DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - a database url of the form  <code>jdbc:<em>subprotocol</em>:<em>subname</em></code><DD><CODE>user</CODE> - the database user on whose behalf the connection is being   made<DD><CODE>password</CODE> - the user's password<DT><B>Returns:</B><DD>a connection to the URL<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="getConnection(java.lang.String)"><!-- --></A><H3>getConnection</H3><PRE>public static <A HREF="../../java/sql/Connection.html">Connection</A> <B>getConnection</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;url)                                throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Attempts to establish a connection to the given database URL. The <code>DriverManager</code> attempts to select an appropriate driver from the set of registered JDBC drivers.<DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - a database url of the form   <code> jdbc:<em>subprotocol</em>:<em>subname</em></code><DT><B>Returns:</B><DD>a connection to the URL<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="getDriver(java.lang.String)"><!-- --></A><H3>getDriver</H3><PRE>public static <A HREF="../../java/sql/Driver.html">Driver</A> <B>getDriver</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;url)                        throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Attempts to locate a driver that understands the given URL. The <code>DriverManager</code> attempts to select an appropriate driver from the set of registered JDBC drivers.<DD><DL><DT><B>Parameters:</B><DD><CODE>url</CODE> - a database URL of the form      <code>jdbc:<em>subprotocol</em>:<em>subname</em></code><DT><B>Returns:</B><DD>a <code>Driver</code> object representing a driver that can connect to the given URL<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="registerDriver(java.sql.Driver)"><!-- --></A><H3>registerDriver</H3><PRE>public static void <B>registerDriver</B>(<A HREF="../../java/sql/Driver.html">Driver</A>&nbsp;driver)                           throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Registers the given driver with the <code>DriverManager</code>. A newly-loaded driver class should call the method <code>registerDriver</code> to make itself known to the <code>DriverManager</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>driver</CODE> - the new JDBC Driver that is to be registered with the               <code>DriverManager</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="deregisterDriver(java.sql.Driver)"><!-- --></A><H3>deregisterDriver</H3><PRE>public static void <B>deregisterDriver</B>(<A HREF="../../java/sql/Driver.html">Driver</A>&nbsp;driver)                             throws <A HREF="../../java/sql/SQLException.html">SQLException</A></PRE><DL><DD>Drops a Driver from the <code>DriverManager</code>'s list.  Applets can only deregister Drivers from their own classloaders.<DD><DL><DT><B>Parameters:</B><DD><CODE>driver</CODE> - the JDBC Driver to drop<DT><B>Throws:</B><DD><CODE><A HREF="../../java/sql/SQLException.html">SQLException</A></CODE> - if a database access error occurs</DL></DD></DL><HR><A NAME="getDrivers()"><!-- --></A><H3>getDrivers</H3><PRE>public static <A HREF="../../java/util/Enumeration.html">Enumeration</A> <B>getDrivers</B>()</PRE><DL><DD>Retrieves an Enumeration with all of the currently loaded JDBC drivers to which the current caller has access. <P><B>Note:</B> The classname of a driver can be found using <CODE>d.getClass().getName()</CODE><DD><DL><DT><B>Returns:</B><DD>the list of JDBC Drivers loaded by the caller's class loader</DL></DD></DL><HR><A NAME="setLoginTimeout(int)"><!-- --></A><H3>setLoginTimeout</H3><PRE>public static void <B>setLoginTimeout</B>(int&nbsp;seconds)</PRE><DL><DD><p>Sets the maximum time in seconds that a driver will wait while attempting to connect to a database.<DD><DL><DT><B>Parameters:</B><DD><CODE>seconds</CODE> - the login time limit in seconds</DL></DD></DL><HR><A NAME="getLoginTimeout()"><!-- --></A><H3>getLoginTimeout</H3><PRE>public static int <B>getLoginTimeout</B>()</PRE><DL><DD>Gets the maximum time in seconds that a driver can wait when attempting to log in to a database.<DD><DL><DT><B>Returns:</B><DD>the driver login time limit in seconds</DL></DD></DL><HR><A NAME="setLogStream(java.io.PrintStream)"><!-- --></A><H3>setLogStream</H3><PRE>public static void <B>setLogStream</B>(<A HREF="../../java/io/PrintStream.html">PrintStream</A>&nbsp;out)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I></I>&nbsp;<P><DD>Sets the logging/tracing PrintStream that is used by the <code>DriverManager</code> and all drivers.<P> In the Java 2 SDK, Standard Edition, version 1.3 release, this method checks to see that there is an <code>SQLPermission</code> object before setting the logging stream.  If a <code>SecurityManager</code> exists and its <code>checkPermission</code> method denies setting the log writer, this method throws a <code>java.lang.SecurityException</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>out</CODE> - the new logging/tracing PrintStream; to disable, set to <code>null</code><DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/SecurityException.html">SecurityException</A></CODE> - if a security manager exists and its    <code>checkPermission</code> method denies    setting the log stream.<DT><B>See Also: </B><DD><A HREF="../../java/lang/SecurityManager.html#checkPermission(java.security.Permission)"><CODE>SecurityManager.checkPermission(java.security.Permission)</CODE></A></DL></DD></DL><HR><A NAME="getLogStream()"><!-- --></A><H3>getLogStream</H3><PRE>public static <A HREF="../../java/io/PrintStream.html">PrintStream</A> <B>getLogStream</B>()</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I></I>&nbsp;<P><DD>Gets the logging/tracing PrintStream that is used by the <code>DriverManager</code> and all drivers.<DD><DL><DT><B>Returns:</B><DD>the logging/tracing PrintStream; if disabled, is <code>null</code></DL></DD></DL><HR><A NAME="println(java.lang.String)"><!-- --></A><H3>println</H3><PRE>public static void <B>println</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;message)</PRE><DL><DD>Prints a message to the current JDBC log stream.<DD><DL><DT><B>Parameters:</B><DD><CODE>message</CODE> - a log or tracing message</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=2 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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DriverManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/sql/Date.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/sql/DriverPropertyInfo.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>  &nbsp;&nbsp;<A HREF="DriverManager.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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