提交 d9a94ab2 authored 作者: Thomas Mueller's avatar Thomas Mueller

Use a constant for "--hide--"

上级 1c2cd451
......@@ -17,6 +17,13 @@ import org.h2.engine.Constants;
*/
public class JdbcSQLException extends SQLException {
/**
* If the SQL statement contains this text, then it is never added to the
* SQL exception. Hiding the SQL statement may be important if it contains a
* passwords, such as a CREATE LINKED TABLE statement.
*/
public static final String HIDE_SQL = "--hide--";
private static final long serialVersionUID = 1L;
private final String originalMessage;
private final Throwable cause;
......@@ -144,7 +151,7 @@ public class JdbcSQLException extends SQLException {
* INTERNAL
*/
public void setSQL(String sql) {
if (sql.indexOf("--hide--") < 0) {
if (sql.indexOf(HIDE_SQL) < 0) {
this.sql = sql;
buildMessage();
}
......
......@@ -20,6 +20,7 @@ import org.h2.engine.Session;
import org.h2.index.Index;
import org.h2.index.IndexType;
import org.h2.index.LinkedIndex;
import org.h2.jdbc.JdbcSQLException;
import org.h2.log.UndoLogRecord;
import org.h2.message.Message;
import org.h2.message.Trace;
......@@ -325,7 +326,7 @@ public class TableLink extends Table {
if (readOnly) {
buff.append(" READONLY");
}
buff.append(" /*--hide--*/");
buff.append(" /*" + JdbcSQLException.HIDE_SQL + "*/");
return buff.toString();
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论