Wiki source code of JDBC and Entity Modeler
Version 11.1 by Lachlan Scott on 2007/07/11 15:57
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
11.1 | 1 | ==== Problem: You encounter the 'JDBC connection failed for driver ...' error message when trying to generate SQL in Entity Modeler. ==== |
| |
9.1 | 2 | |
| |
11.1 | 3 | [[image:JDBC connection failed.jpg||]] |
| |
9.1 | 4 | |
| 5 | ==== **Discussion** ==== | ||
| 6 | |||
| 7 | Either the JDBC driver genuinely cannot be found, or more likely perhaps, your JDBC settings in Entity Modeler are incorrect. | ||
| 8 | |||
| 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. | ||
| 10 | |||
| 11 | Put your JDBC drivers into the /Library/Java/Extensions then, and they should be picked up automatically by Eclipse. | ||
| 12 | |||
| 13 | ==== **Solution - check that your JDBC driver is in your CLASSPATH:** ==== | ||
| 14 | |||
| 15 | Check your classpath settings in Eclipse as follows: | ||
| |
11.1 | 16 | [[image:Checking_CLASSPATH.jpg||]] |
| |
9.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 | ||
| 20 | * Open the JRE System Library list, and you should see your available JDBC driver (see screenshot) | ||
| |
11.1 | 21 | * If you cannot see your driver listed, you must add it. instructions required |
| |
9.1 | 22 | |
| 23 | ==== **Solution - check JDBC settings in Entity Modeler** ==== | ||
| 24 | |||
| |
11.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 | |
| |
11.1 | 27 | [[image:JDBC_correct_settings_mysql.jpg||]] |
| 28 | | ||
| |
9.1 | 29 | |
| |
11.1 | 30 | ==== List of JDBC driver settings ==== |
| |
9.1 | 31 | |
| 32 | **MySQL JDBC driver settings:** | ||
| 33 | |||
| |
11.1 | 34 | URL: jdbc:mysql:~/~/<hostname>/<database//name>. eg. jdbc:mysql:~/~/localhost/authors |
| 35 | Driver: com.mysql.jdbc.Driver// | ||
| |
9.1 | 36 | |
| 37 | **OpenBase JDBC driver settings:** | ||
| 38 | |||
| |
11.1 | 39 | URL: jdbc:openbase:~/~/<hostname>/<database//name>. eg. jdbc:openbase:~/~/localhost/authors |
| 40 | Driver: com.openbase.jdbc.ObDriver | ||
| 41 | \\// |