Results 1 to 2 of 2

Thread: Access to a jnit's embedded database within db explorer

Hybrid View

  1. #1

    Default Access to a jnit's embedded database within db explorer

    Probably a stupid quiestion - but I'l dare to ask it

    Is it possible to connect to an embeded database constructed by a junit test in debug mode via STS database explorer, and subsequently run queries against it.

    I have tried but when I connect to the datebase (H2 & HSQL) the connections always have no table contents. A specific example being: The mobile application greenhouse uses embeded databases in its JdbcEventRepositoryTest.java junit tests. The database being established via EmbeddedDatabaseFactory.java. If I stop on breakpoint & use the configuration data for the database within a STS database explorer's connection the resulting schema is empty suggesting either what I am trying to do is not possible or that I have not properly identified the connection parameters.

    any ideas?

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello

    Is it possible to connect to an embeded database constructed by a junit test in debug mode via STS database explorer, and subsequently run queries against it.
    You can create a embedded DB or in-memory DB used only for Testing purposes how for example JUnit. With or without STS

    I have tried but when I connect to the datebase (H2 & HSQL) the connections always have no table contents.
    Be sure you are including a script to create DB Schema, other scripts could be to insert or load some predefined data to test

    Could you post your embedded DB declaration?
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •