本文整理汇总了Java中org.h2.message.DbException.traceThrowable方法的典型用法代码示例。如果您正苦于以下问题:Java DbException.traceThrowable方法的具体用法?Java DbException.traceThrowable怎么用?Java DbException.traceThrowable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.h2.message.DbException
的用法示例。
在下文中一共展示了DbException.traceThrowable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* Close the transfer object and the socket.
*/
public synchronized void close() {
if (socket != null) {
try {
if (out != null) {
out.flush();
}
if (socket != null) {
socket.close();
}
} catch (IOException e) {
DbException.traceThrowable(e);
} finally {
socket = null;
}
}
}
示例2: readTranslations
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* Read the translation for this language and save them in the 'text'
* property of this session.
*
* @param session the session
* @param language the language
*/
void readTranslations(WebSession session, String language) {
Properties text = new Properties();
try {
trace("translation: "+language);
byte[] trans = getFile("_text_"+language+".prop");
trace(" "+new String(trans));
text = SortedProperties.fromLines(new String(trans, Constants.UTF8));
// remove starting # (if not translated yet)
for (Entry<Object, Object> entry : text.entrySet()) {
String value = (String) entry.getValue();
if (value.startsWith("#")) {
entry.setValue(value.substring(1));
}
}
} catch (IOException e) {
DbException.traceThrowable(e);
}
session.put("text", new HashMap<Object, Object>(text));
}
示例3: getInfo
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* Update session meta data information and get the information in a map.
*
* @return a map containing the session meta data
*/
HashMap<String, Object> getInfo() {
HashMap<String, Object> m = New.hashMap();
m.putAll(map);
m.put("lastAccess", new Timestamp(lastAccess).toString());
try {
m.put("url", conn == null ?
"${text.admin.notConnected}" : conn.getMetaData().getURL());
m.put("user", conn == null ?
"-" : conn.getMetaData().getUserName());
m.put("lastQuery", commandHistory.size() == 0 ?
"" : commandHistory.get(0));
m.put("executing", executingStatement == null ?
"${text.admin.no}" : "${text.admin.yes}");
} catch (SQLException e) {
DbException.traceThrowable(e);
}
return m;
}
示例4: loadProperties
import org.h2.message.DbException; //导入方法依赖的package包/类
private Properties loadProperties() {
try {
if ("null".equals(serverPropertiesDir)) {
return new Properties();
}
return SortedProperties.loadProperties(
serverPropertiesDir + "/" + Constants.SERVER_PROPERTIES_NAME);
} catch (Exception e) {
DbException.traceThrowable(e);
return new Properties();
}
}
示例5: saveProperties
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* Save the settings to the properties file.
*
* @param prop null or the properties webPort, webAllowOthers, and webSSL
*/
synchronized void saveProperties(Properties prop) {
try {
if (prop == null) {
Properties old = loadProperties();
prop = new SortedProperties();
prop.setProperty("webPort",
"" + SortedProperties.getIntProperty(old,
"webPort", port));
prop.setProperty("webAllowOthers",
"" + SortedProperties.getBooleanProperty(old,
"webAllowOthers", allowOthers));
prop.setProperty("webSSL",
"" + SortedProperties.getBooleanProperty(old,
"webSSL", ssl));
if (commandHistoryString != null) {
prop.setProperty(COMMAND_HISTORY, commandHistoryString);
}
}
ArrayList<ConnectionInfo> settings = getSettings();
int len = settings.size();
for (int i = 0; i < len; i++) {
ConnectionInfo info = settings.get(i);
if (info != null) {
prop.setProperty(String.valueOf(len - i - 1), info.getString());
}
}
if (!"null".equals(serverPropertiesDir)) {
OutputStream out = FileUtils.newOutputStream(
serverPropertiesDir + "/" + Constants.SERVER_PROPERTIES_NAME, false);
prop.store(out, "H2 Server Properties");
out.close();
}
} catch (Exception e) {
DbException.traceThrowable(e);
}
}
示例6: addConnection
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* Add a connection to the management database.
*
* @param id the connection id
* @param url the database URL
* @param user the user name
*/
synchronized void addConnection(int id, String url, String user) {
try {
managementDbAdd.setInt(1, id);
managementDbAdd.setString(2, url);
managementDbAdd.setString(3, user);
managementDbAdd.execute();
} catch (SQLException e) {
DbException.traceThrowable(e);
}
}
示例7: removeConnection
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* Remove a connection from the management database.
*
* @param id the connection id
*/
synchronized void removeConnection(int id) {
try {
managementDbRemove.setInt(1, id);
managementDbRemove.execute();
this.executors.remove(id);
} catch (SQLException e) {
DbException.traceThrowable(e);
}
}
示例8: stopManagementDb
import org.h2.message.DbException; //导入方法依赖的package包/类
private synchronized void stopManagementDb() {
if (managementDb != null) {
try {
managementDb.close();
} catch (SQLException e) {
DbException.traceThrowable(e);
}
managementDb = null;
}
}
示例9: run
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* INTERNAL
*/
@Override
public void run() {
try {
service.listen();
} catch (Exception e) {
DbException.traceThrowable(e);
}
}
示例10: load
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* INTERNAL
*/
public static synchronized Driver load() {
try {
if (!registered) {
registered = true;
DriverManager.registerDriver(INSTANCE);
}
} catch (SQLException e) {
DbException.traceThrowable(e);
}
return INSTANCE;
}
示例11: unload
import org.h2.message.DbException; //导入方法依赖的package包/类
/**
* INTERNAL
*/
public static synchronized void unload() {
try {
if (registered) {
registered = false;
DriverManager.deregisterDriver(INSTANCE);
}
} catch (SQLException e) {
DbException.traceThrowable(e);
}
}