Announcement Announcement Module
Collapse
No announcement yet.
Newbie setup of jdbc for db derby Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Newbie setup of jdbc for db derby

    I'm new to spring and attempting to setup a jdbc connection on a roo project. I'm using Derby 10.8.1 and have successfully connected via the eclipse ide (ping). However, I receive jdbc connection errors when I attempt to connect my project.

    I have two questions.

    How do I determine the proper database url (seen in the database.properties file) for my project connection?

    Where do I find the system information for the Derby Network database that I'm running?


    Thanks in advance.

  • #2
    Hello

    However, I receive jdbc connection errors when I attempt to connect my project.
    Post the complete error stack trace and use code tags for that.

    How do I determine the proper database url (seen in the database.properties file) for my project connection?
    Check Derby's documentation, examples must exists there about how write a correct URL


    Where do I find the system information for the Derby Network database that I'm running?
    Again check Derby's documentation

    Comment


    • #3
      Originally posted by dr_pompeii View Post
      Hello


      Post the complete error stack trace and use code tags for that.


      Check Derby's documentation, examples must exists there about how write a correct URL



      Again check Derby's documentation


      My apologies for the lack of clarity. The jdbc connection properties dialog box that I use to connect in the ide gives the following url:

      jdbc:derby://localhost:1527/MyDatabase;create=true

      I can successfully connect to this network database using the ide. However, when I build my application, I receive a connection error related to the jdbc driver as follows:

      2011-12-16 11:38:26,404 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaExport - schema export unsuccessful
      org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.apache.derby.jdbc.EmbeddedDriver' for connect URL 'jdbc:derby://localhost:1527/MyDatabase;create=true'
      at org.apache.commons.dbcp.BasicDataSource.createConn ectionFactory(BasicDataSource.java:1452)
      at org.apache.commons.dbcp.BasicDataSource.createData Source(BasicDataSource.java:1371)
      at org.apache.commons.dbcp.BasicDataSource.getConnect ion(BasicDataSource.java:1044)
      at org.hibernate.ejb.connection.InjectedDataSourceCon nectionProvider.getConnection(InjectedDataSourceCo nnectionProvider.java:71)
      at org.hibernate.tool.hbm2ddl.SuppliedConnectionProvi derConnectionHelper.prepare(SuppliedConnectionProv iderConnectionHelper.java:51)
      at org.hibernate.tool.hbm2ddl.SchemaExport.execute(Sc hemaExport.java:263)
      at org.hibernate.tool.hbm2ddl.SchemaExport.create(Sch emaExport.java:219)
      at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:372)
      at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1872)


      I'm using the same url connection parameters, but it seems to have some sort of error with the jdbc driver. Any thoughts?

      Comment


      • #4
        Hello

        Next time use the code tags

        I can successfully connect to this network database using the ide.
        Which IDE is? I hope this IDE has no a embedded Derby and you are not connecting really to the embedded database

        I guess you have downloaded and installed Apache Derby.
        I assume you have started the Derby DB, right?

        What Derby and java driver version you are using?

        Comment


        • #5
          Originally posted by dr_pompeii View Post

          Which IDE is? I hope this IDE has no a embedded Derby and you are not connecting really to the embedded database

          I guess you have downloaded and installed Apache Derby.
          I assume you have started the Derby DB, right?

          What Derby and java driver version you are using?

          The IDE I'm using is Eclipse (Indigo Service Release 1) 3.7.1. I've downloaded and installed Apache Derby. The database is running - this is how I successfully connect via the IDE.

          I'm using Derby 10.8.1.2 and I'm not certain about the java driver version. This goes back to my original question - how can I find the system information for the Derby Network database that I'm running?

          Comment


          • #6
            This goes back to my original question - how can I find the system information for the Derby Network database that I'm running?
            You are not working on network since you are using jdbc:derby://localhost:1527/MyDatabase;create=true

            and I'm not certain about the java driver version.
            I assume you have downloaded the jar driver from Derby's home page right?.

            Comment


            • #7
              You are not working on network since you are using jdbc:derby://localhost:1527/MyDatabase;create=true
              OK.

              I assume you have downloaded the jar driver from Derby's home page right?.
              I downloaded the derby database and an eclipse plugin for database connectivity. The eclipse plugin is successfully connecting to the derby database where I can see the database and browse the schema.

              Comment

              Working...
              X