2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DbEnv.set_error_stream</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>DbEnv.set_error_stream</h1>
18
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
23
import com.sleepycat.db.*;
25
public void DbEnv.set_error_stream(OutputStream s)
29
<p>When an error occurs in the Berkeley DB library, an exception is thrown. In
30
some cases, however, the <b>errno</b> value may be insufficient to
31
completely describe the cause of the error, especially during initial
32
application debugging.
33
<p>The DbEnv.set_error_stream and <a href="../api_java/db_set_error_stream.html">Db.set_error_stream</a> methods
34
are used to enhance the mechanism for reporting error messages to the
35
application by setting a OutputStream to be used for displaying additional
36
Berkeley DB error messages. In some cases, when an error occurs, Berkeley DB will
37
output an additional error message to the specified stream.
38
<p>The error message will consist of the prefix string and a colon
39
("<b>:</b>") (if a prefix string was previously specified using
40
<a href="../api_java/env_set_errpfx.html">DbEnv.set_errpfx</a>), an error string, and a trailing
41
<newline> character.
42
<p>Alternatively, you can use the <a href="../api_java/env_set_errcall.html">DbEnv.set_errcall</a> method to capture the
43
additional error information in a way that does not use output streams.
44
You should not mix these approaches.
45
<p>This error-logging enhancement does not slow performance or significantly
46
increase application size, and may be run during normal operation as well
47
as during application debugging.
49
<a href="../api_java/env_class.html">DbEnv</a>
51
<a href="../api_java/env_list.html">Database Environments and Related Methods</a>
53
<table width="100%"><tr><td><br></td><td align=right>
54
<a href="../api_java/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
56
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>