“尝试打开SQL连接时发生意外错误."使用SQuirreL SQL Client 3.5.0打开InMemory DB时 [英] "Unexpected Error occurred attempting to open an SQL connection." when opening InMemory DB using SQuirreL SQL Client 3.5.0

查看:147
本文介绍了“尝试打开SQL连接时发生意外错误."使用SQuirreL SQL Client 3.5.0打开InMemory DB时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个事件生成机制,可以生成&将事件保存在一个平面文件中(或说数据库文件以使其变得容易).

We have an event generation mechanism that generates & save the events in a flatfile (or say DB file to make it easy).

要在数据库中查看此事件,我们需要完成运行以生成事件&然后我们使用"SQuirreL SQL Client 3.5.0".

To view this event in DB we complete the run for generating the events & then we use "SQuirreL SQL Client 3.5.0".

当此数据库文件的大小小时,SQuirreL Client可以正常工作.但是,当大小增加到接近20MB时,它拒绝打开数据库&;抛出以下异常-

When the size of this db file is small SQuirreL Client works fine. But when the size grows near to 20MB, it refuses to open the database & throws below exception -

尝试打开SQL连接时发生意外错误.

Unexpected Error occurred attempting to open an SQL connection.

下面是StackTrace供您参考:

Below is the StackTrace for your reference:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.sql.SQLException: Out of Memory
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:202)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: java.sql.SQLException: Out of Memory
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:171)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)
    ... 5 more
Caused by: java.sql.SQLException: Out of Memory
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCConnection.<init>(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.getConnection(Unknown Source)
    at org.hsqldb.jdbc.JDBCDriver.connect(Unknown Source)
    at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)
    at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)
    ... 7 more
Caused by: org.hsqldb.HsqlException: Out of Memory
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.persist.ScriptRunner.runScript(Unknown Source)
    at org.hsqldb.persist.ScriptRunner.runScript(Unknown Source)
    at org.hsqldb.persist.Log.processLog(Unknown Source)
    at org.hsqldb.persist.Log.open(Unknown Source)
    at org.hsqldb.persist.Logger.openPersistence(Unknown Source)
    at org.hsqldb.Database.reopen(Unknown Source)
    at org.hsqldb.Database.open(Unknown Source)
    at org.hsqldb.DatabaseManager.getDatabase(Unknown Source)
    at org.hsqldb.DatabaseManager.newSession(Unknown Source)
    ... 12 more

推荐答案

尝试增加分配给SQuirreL的内存.在文本编辑器中打开脚本或批处理文件,然后更改分配的内存量.寻找 -Xmx256m 并将256替换为更大的数字.

Try increasing the memory allocated to SQuirreL. Open the script or batch file in a text editor and change the amount of memory allocated. Look for -Xmx256m and replace the 256 with a larger number.

在Windows上,文件为 squirrel-sql.bat ,在Linux上,文件为 squirrel-sql.sh

On Windows the file is squirrel-sql.bat, on Linux it is squirrel-sql.sh

这篇关于“尝试打开SQL连接时发生意外错误."使用SQuirreL SQL Client 3.5.0打开InMemory DB时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆