次の方法で共有


DriverManager.LogWriter Property

Definition

Retrieves the log writer. -or- Sets the logging/tracing PrintWriter object that is used by the DriverManager and all drivers.

public static Java.IO.PrintWriter? LogWriter { [Android.Runtime.Register("getLogWriter", "()Ljava/io/PrintWriter;", "")] get; [Android.Runtime.Register("setLogWriter", "(Ljava/io/PrintWriter;)V", "")] set; }
[<get: Android.Runtime.Register("getLogWriter", "()Ljava/io/PrintWriter;", "")>]
[<set: Android.Runtime.Register("setLogWriter", "(Ljava/io/PrintWriter;)V", "")>]
static member LogWriter : Java.IO.PrintWriter with get, set

Property Value

a java.io.PrintWriter object

Attributes

Remarks

Property getter documentation:

Retrieves the log writer.

The getLogWriter and setLogWriter methods should be used instead of the get/setlogStream methods, which are deprecated.

Added in 1.2.

Java documentation for java.sql.DriverManager.getLogWriter().

Property setter documentation:

Sets the logging/tracing PrintWriter object that is used by the DriverManager and all drivers.

There is a minor versioning problem created by the introduction of the method setLogWriter. The method setLogWriter cannot create a PrintStream object that will be returned by getLogStream---the Java platform does not provide a backward conversion. As a result, a new application that uses setLogWriter and also uses a JDBC 1.0 driver that uses getLogStream will likely not see debugging information written by that driver.

Starting with the Java 2 SDK, Standard Edition, version 1.3 release, this method checks to see that there is an SQLPermission object before setting the logging stream. If a SecurityManager exists and its checkPermission method denies setting the log writer, this method throws a java.lang.SecurityException.

Added in 1.2.

Java documentation for java.sql.DriverManager.setLogWriter(java.io.PrintWriter).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to