Open resource database using currentContext

  • Anonymous - 2010-01-07


    Using a resource connection (jdbc:hsqldb:res: ) you can easily distibute your database as a single zip-file but because the file must be added to the classpath it is limited. Since you can't change the system class loader (without hack, you can't add or change the file att runtime. But you can change the thread context class loader.

    So I suggest that you first try to load the resource using


    . If that fails, try to load the resource from the context classloader,



    The optimal solution would be to create a new type of connection (jdbc:hsqldb:zip: ) but that is a bigger task to do.


  • Fred Toussi

    Fred Toussi - 2010-01-12

    I have changed the code as suggested. Please check with the code in svn /base/trunk


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks