Error while connecting to database

10 views
Skip to first unread message

Mahmoud Ammar

unread,
May 27, 2015, 7:36:15 AM5/27/15
to uby-...@googlegroups.com
Could someone help me to fix this error?? I'm trying to apply the code examples and always this error appears



thanks in advance

Christian M. Meyer

unread,
May 27, 2015, 9:05:59 AM5/27/15
to uby-...@googlegroups.com
Hi there,

in order to help you, we need to know
* which database you are using (mysql or h2, which version?)
* how your pom file looks like, especially which UBY version you are using as a dependency
* which connection parameters you are using (i.e., the params you use to instanciate the UBY object)

A first guess is that the database is not at the correct location or that there's a version conflict.

best wishes,
Christian

Mahmoud Ammar

unread,
May 27, 2015, 11:46:46 AM5/27/15
to uby-...@googlegroups.com
Hi, thanks for your response
Actually, I faced this error with both types of databases but let's focus on H2 database and version 7
I attached you my pom file to see it. but I think its organized well

these are my parameters

    public static final String DB_URL = "jdbc:h2:file:ubymedium070";
    public static final String DB_DRIVER = "org.h2.Driver";
    public static final String DB_DRIVER_NAME = "h2";
    public static final String DB_USERNAME = "sa";
    public static final String DB_PASSWORD = "";

please not that I put my database in the netbeans project directly

Thanks in advance
pom.xml

Christian M. Meyer

unread,
May 27, 2015, 12:02:07 PM5/27/15
to uby-...@googlegroups.com
Hi, the pom file is totally correct, so in theory it should work. In practice, could you please check

(1) if the database path can be resolved? Relative paths should generally work, but I don't know how Netbeans handles that. You could try an absolute path first and then try to identify the correct relative one. In Eclipse, it's always the main project folder, to if the H2 database is located in a folder "embeddedUby", use "jdbc:h2:file:embeddedUby/ubymedium070" as the connection URL.

(2) by any chance, did you decompress the database properly? The H2 variant should end in the suffix ".h2.db" The medium version should have ~4.7 GB.

Best!



Am Mittwoch, 27. Mai 2015 13:36:15 UTC+2 schrieb Mahmoud Ammar:
Reply all
Reply to author
Forward
0 new messages