Hi,

H2 supports reading from the classpath. This should also work:

    RUNSCRIPT FROM 'classpath:/com/acme/test.sql'

See also http://h2database.com/html/advanced.html#file_system

Regards,
Thomas



On Mon, Feb 10, 2014 at 12:51 PM, Noel Grandin <[email protected]>wrote:

>
> Something like this should work:
>
> public static void MyTest {
>   void f(Connection conn) {
>     org.h2.tools.RunScript.execute(conn, new InputStreamReader(MyTest.
> class.getResourceAsStream("xxxx"));
>
>   }
> }
>
>
> On 2014-02-10 12:29, Rémy Schumm wrote:
>
>> I try to do a veery easy JUnit-Tests whitch triggers a RUNSCRIPT FROM...
>>
>> *I find no way to load the SQL-file realtively. *
>>
>>
>> The SQL-File is placed into src/test/resources
>>
>>
>> Here is the code which makes the Problem:
>> https://gist.github.com/rschumm/8913517
>>
>>
>> Does somebody have an idea how to make H2 find this file? That'll be
>> great...
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "H2 Database" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to