Wiki source code of JDBC and Entity Modeler
Last modified by Theodore Petrosky on 2017/04/02 18:37
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
27.1 | 1 | ==== Problem: You encounter the 'JDBC connection failed for driver ...' error message when trying to generate SQL in Entity Modeler. ==== |
![]() |
9.1 | 2 | |
![]() |
27.1 | 3 | [[image:attach:JDBC connection failed.jpg]] |
![]() |
9.1 | 4 | |
![]() |
21.1 | 5 | ==== **Discussion** ==== |
![]() |
9.1 | 6 | |
![]() |
23.1 | 7 | Either the JDBC driver genuinely cannot be found, or more likely perhaps, your JDBC settings in Entity Modeler are incorrect. |
![]() |
9.1 | 8 | |
![]() |
23.1 | 9 | On Mac OS X, the /Library/Java/Extensions directory is provided for extensions to the core Java API, and is thus the appropriate place for JDBC drivers. |
![]() |
9.1 | 10 | |
![]() |
23.1 | 11 | Put your JDBC drivers into the /Library/Java/Extensions then, and they should be picked up automatically by Eclipse. |
![]() |
9.1 | 12 | |
![]() |
23.1 | 13 | ==== **Solution - check that your JDBC driver is in your CLASSPATH:** ==== |
![]() |
21.1 | 14 | |
15 | Check your classpath settings in Eclipse as follows: | ||
![]() |
27.1 | 16 | [[image:attach:Checking_CLASSPATH.jpg]] |
![]() |
21.1 | 17 | |
18 | * Right-click the project in Package Explorer | ||
19 | * Select Java Build Path from the left hand list, and Libraries from the tabs in the main field | ||
![]() |
23.1 | 20 | * Open the JRE System Library list, and you should see your available JDBC driver (see screenshot) |
![]() |
27.1 | 21 | * If you cannot see your driver listed, you must add it. [WOL:instructions required] |
![]() |
21.1 | 22 | |
23 | ==== **Solution - check JDBC settings in Entity Modeler** ==== | ||
24 | |||
![]() |
27.1 | 25 | Check that the settings for your JDBC driver are correct; these details are provided by the suppliers. MySQL settings are shown in the screenshot (see screenshot). Note that drivers have peculiar use of capitalization, and that //this must be correct// for the driver to function! |
![]() |
9.1 | 26 | |
![]() |
27.1 | 27 | [[image:attach:JDBC_correct_settings_mysql.jpg]] |
28 | |||
![]() |
21.1 | 29 | |
![]() |
27.1 | 30 | ==== List of JDBC driver settings ==== |
![]() |
21.1 | 31 | |
![]() |
23.1 | 32 | **Derby JDBC driver settings:** |
![]() |
27.1 | 33 | Embedded Derby, how is it done? |
34 | How do you set property derby.system.home so Entity Modeler can be used? | ||
![]() |
23.1 | 35 | |
![]() |
9.1 | 36 | **MySQL JDBC driver settings:** |
37 | |||
![]() |
27.1 | 38 | URL: jdbc:mysql:~/~/<hostname>/<database_name>. eg. jdbc:mysql:~/~/localhost/authors |
39 | Driver: com.mysql.jdbc.Driver | ||
![]() |
9.1 | 40 | |
41 | **OpenBase JDBC driver settings:** | ||
42 | |||
![]() |
27.1 | 43 | URL: jdbc:openbase:~/~/<hostname>/<database_name>. eg. jdbc:openbase:~/~/localhost/authors |
44 | Driver: com.openbase.jdbc.ObDriver | ||
![]() |
23.1 | 45 | |
46 | **FrontBase JDBC driver settings:** | ||
47 | |||
![]() |
27.1 | 48 | URL: jdbc:FrontBase:~/~/<hostname>/<database_name>. eg. jdbc:FrontBase:~/~/localhost/authors |
49 | Driver: | ||
![]() |
23.1 | 50 | |
51 | **Postgresql JDBC driver settings:** | ||
![]() |
27.1 | 52 | URL: jdbc:postgresql:~/~/<hostname>/<databasename> eg. jdbc:postgresql:~/~/localhost/authors |
53 | Driver: org.postgresql.Driver | ||
54 | Plugin: Postgresql | ||
![]() |
25.1 | 55 | |
56 | **H2 JDBC driver settings:** | ||
![]() |
27.1 | 57 | URL: jdbc:h2:~~/<databasename>\\ |
58 | |||
59 | **Oracle JDBC driver settings:** | ||
60 | URL: jdbc:oracle:thin:@<hostname>:1521/SID using Java jar ojdbc6.jar downloaded from Oracle's website (account needed, but free) | ||
61 | |||
62 | |||
63 | |||
64 |