Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Scout/Tutorial/3.7/Database Development Perspective"
(→Configure the Database Development View) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{ScoutPage|cat=Tutorial}} | + | {{ScoutPage|cat=Tutorial 3.7}} |
=Configure the Database Development View = | =Configure the Database Development View = | ||
+ | |||
+ | This page shows how to install, configure and use the database development view in eclipse. | ||
+ | |||
+ | Alternatively, using and browsing Derby databases on the command line is shown at the end | ||
==Install Database Development== | ==Install Database Development== | ||
Line 8: | Line 12: | ||
On Install dialog fill the ''Work with'' drop-down list with ''--All Available Sites--'' and tick the checkbox ''Database Development'' | On Install dialog fill the ''Work with'' drop-down list with ''--All Available Sites--'' and tick the checkbox ''Database Development'' | ||
<br/>[[Image:Db_1a.png|left]]<br clear="all" /> | <br/>[[Image:Db_1a.png|left]]<br clear="all" /> | ||
+ | |||
+ | Step through the install dialog and restart your Eclipse | ||
==Add new Derby Connection== | ==Add new Derby Connection== | ||
Line 34: | Line 40: | ||
<br/>[[Image:Db_10.png|left]]<br clear="all" /> | <br/>[[Image:Db_10.png|left]]<br clear="all" /> | ||
<br/>[[Image:Db_11.png|left]]<br clear="all" /> | <br/>[[Image:Db_11.png|left]]<br clear="all" /> | ||
+ | |||
+ | ==Access the Derby database on the Command Line== | ||
+ | Change to the library folder of your Derby installation, then type the following in the DOS shell to connect to your database. | ||
+ | |||
+ | C:\DerbyDB\db-derby-10.6.2.1-bin\lib>java -classpath derby.jar;derbytools.jar org.apache.derby.tools.ij | ||
+ | ij version 10.6 | ||
+ | ij> connect 'jdbc:derby:c:/derbydb'; | ||
+ | |||
+ | Remark: For the above example the derby installation is found under ''C:\DerbyDB\db-derby-10.6.2.1-bin'' and the data base is stored directly under ''C:\DerbyDB'' | ||
+ | |||
+ | |||
+ | {{warning|Troubleshooting|If you get an error message similar to | ||
+ | <code>ERROR XJ040: Failed to start database 'c:/derbydb' with class loader sun.misc.Launcher$AppClassLoader...</code> | ||
+ | |||
+ | <code>ERROR XSDB6: Another instance of Derby may have already booted the database C:\DerbyDB</code> | ||
+ | you might still have your Scout server running that is accessing the database. If so, stop the server in the Scout perspective and try again.}} | ||
+ | |||
+ | Once connected you may browse, change, ... | ||
+ | |||
+ | ij> show schemas; | ||
+ | TABLE_SCHEM | ||
+ | ------------------------------ | ||
+ | APP | ||
+ | MINICRM | ||
+ | ... | ||
+ | |||
+ | ij> show tables in minicrm; | ||
+ | TABLE_SCHEM |TABLE_NAME |REMARKS | ||
+ | ------------------------------------------------------------------------ | ||
+ | MINICRM |COMPANY | | ||
+ | MINICRM |COMPANY_FIGURES | | ||
+ | MINICRM |CRM_SEQ | | ||
+ | ... | ||
+ | |||
+ | ij> describe minicrm.company; | ||
+ | COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL& | ||
+ | ------------------------------------------------------------------------------ | ||
+ | COMPANY_NR |DECIMAL |0 |10 |5 |NULL |NULL |NO | ||
+ | SHORT_NAME |VARCHAR |NULL|NULL|60 |NULL |120 |NO | ||
+ | ... | ||
+ | |||
+ | Finally | ||
+ | |||
+ | ij> disconnect; | ||
+ | ij> exit; |
Revision as of 08:44, 12 April 2012
The Scout documentation has been moved to https://eclipsescout.github.io/.
Contents
Configure the Database Development View
This page shows how to install, configure and use the database development view in eclipse.
Alternatively, using and browsing Derby databases on the command line is shown at the end
Install Database Development
If you have not yet installed the database development package use menu Help and then Install New Software....
On Install dialog fill the Work with drop-down list with --All Available Sites-- and tick the checkbox Database Development
Step through the install dialog and restart your Eclipse
Add new Derby Connection
Open the Database Development perspective, right click on Database Connections and call the wizard for adding a new database connection by clicking on the context menu New....From the list of available connection profiles, choose Derby.
Specify Driver Details
Open the driver deteail editor by clicking on the round icon to the right of the Drivers combobox.
Choose the embedded derby driver for version 10.2.
Go to the tab Jar List and there specify the location of the derby.jar. If you don't have any, download it (from the official derby website: http://db.apache.org/derby/, it's inside the zip file) or download the TutorialMiniCrmWorkspaceDerbyDB and click on ok to leave this page.
Add the path to your DerbyDb along with the login data (for the minicrm: minicrm/minicrm).
When you have entered all the required data, click on Test connection in order to test the connection details you just entered. If everything is fine there will be a message box Ping succeeded.
Now you can browse through the DerbyDB, modify tables, data, run statements and much more. Please be aware that you cannot have more than one connection to your DerbyDb, therefore either you browse through it in the database development view or you access it using the minicrm, therefore you need to manually disconnect from the database before you can run your application.
Access the Derby database on the Command Line
Change to the library folder of your Derby installation, then type the following in the DOS shell to connect to your database.
C:\DerbyDB\db-derby-10.6.2.1-bin\lib>java -classpath derby.jar;derbytools.jar org.apache.derby.tools.ij ij version 10.6 ij> connect 'jdbc:derby:c:/derbydb';
Remark: For the above example the derby installation is found under C:\DerbyDB\db-derby-10.6.2.1-bin and the data base is stored directly under C:\DerbyDB
Once connected you may browse, change, ...
ij> show schemas; TABLE_SCHEM ------------------------------ APP MINICRM ...
ij> show tables in minicrm; TABLE_SCHEM |TABLE_NAME |REMARKS ------------------------------------------------------------------------ MINICRM |COMPANY | MINICRM |COMPANY_FIGURES | MINICRM |CRM_SEQ | ... ij> describe minicrm.company; COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL& ------------------------------------------------------------------------------ COMPANY_NR |DECIMAL |0 |10 |5 |NULL |NULL |NO SHORT_NAME |VARCHAR |NULL|NULL|60 |NULL |120 |NO ...
Finally
ij> disconnect; ij> exit;