質問

I'm attempting to create a Jasper Report in Jasper Studio. I've successfully set up an H2 embedded Data Source, and successfully tested the connection from inside Jasper Studio.

However, when I try to create a new Jasper Report, Jasper creates a connection to the database, then when it tries to execute the query that I just entered, it gives me the following error:

Database may be already in use: "Locked by another process." Possible solutions: Close all other connection(s); use the server mode

Unfortunately, using the server mode is not an option.

Jasper also allows you to explicitly choose an embedded H2 file database as a Data Source, but it doesn't look like it is actually supported.

Does anyone know how to configure Jasper to work with an embedded H2 database?

Does Jasper even work with any embedded databases?

EDIT: The only way I've been able to get Jasper to create a Jasper Report that successfully executes a query against an H2 embedded database is if I turn off locking altogether on the database. I edited the Data Adapter in Jasper to have a JDBC URL similar to:

jdbc:h2:file:C:\test_db;FILE_LOCK=NO

役に立ちましたか?

解決

Using FILE_LOCK=NO will corrupt your database.

Instead, use a different connection mode:

他のヒント

try to delete manually db.lck in your embedded database folder (after closing jaspersoft studio).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top