<!--$Id: db_set_error_stream.so,v 10.2 2002/08/18 21:15:54 bostic Exp $--> <!--$Id: env_set_error_stream.so,v 10.19 2002/08/18 21:16:27 bostic Exp $--> <!--Copyright 1997-2002 by Sleepycat Software, Inc.--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> <title>Berkeley DB: Db.set_error_stream</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++"> </head> <body bgcolor=white> <a name="2"><!--meow--></a> <table width="100%"><tr valign=top> <td> <h1>Db.set_error_stream</h1> </td> <td align=right> <a href="../../db4-devel-4.1.25/api_java/c_index.html"><img src="../../db4-4.1.25/images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../../db4-4.1.25/images/ref.gif" alt="Ref"></a> </td></tr></table> <hr size=1 noshade> <tt> <h3><pre> import com.sleepycat.db.*; <p> public void Db.set_error_stream(OutputStream s) throws DbException </pre></h3> <h1>Description</h1> <p>When an error occurs in the Berkeley DB library, an exception is thrown. In some cases, however, the <b>errno</b> value may be insufficient to completely describe the cause of the error, especially during initial application debugging. <p>The <a href="../../db4-devel-4.1.25/api_java/env_set_error_stream.html">DbEnv.set_error_stream</a> and Db.set_error_stream methods are used to enhance the mechanism for reporting error messages to the application by setting a OutputStream to be used for displaying additional Berkeley DB error messages. In some cases, when an error occurs, Berkeley DB will output an additional error message to the specified stream. <p>The error message will consist of the prefix string and a colon ("<b>:</b>") (if a prefix string was previously specified using <a href="../../db4-devel-4.1.25/api_java/env_set_errpfx.html">DbEnv.set_errpfx</a>), an error string, and a trailing <newline> character. <p>Alternatively, you can use the <a href="../../db4-devel-4.1.25/api_java/env_set_errcall.html">DbEnv.set_errcall</a> method to capture the additional error information in a way that does not use output streams. You should not mix these approaches. <p>This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging. <p>For <a href="../../db4-devel-4.1.25/api_java/db_class.html">Db</a> handles opened inside of Berkeley DB environments, calling the Db.set_error_stream method affects the entire environment and is equivalent to calling the <a href="../../db4-devel-4.1.25/api_java/env_set_error_stream.html">DbEnv.set_error_stream</a> method. <h1>Class</h1> <a href="../../db4-devel-4.1.25/api_java/db_class.html">Db</a> <h1>See Also</h1> <a href="../../db4-devel-4.1.25/api_java/db_list.html">Databases and Related Methods</a> </tt> <table width="100%"><tr><td><br></td><td align=right> <a href="../../db4-devel-4.1.25/api_java/c_index.html"><img src="../../db4-4.1.25/images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../../db4-4.1.25/images/ref.gif" alt="Ref"></a> </td></tr></table> <p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font> </body> </html>