In my case i am using Apache Derby database and i wanted to work with it. Before i do that i will have to configure the Derby driver. These are the steps that you can follow to configure and use your database
- In your IDE click on Windows -< Preferences and it will open preferences window. In the preferences window click on Data -< Connectivity -< Driver definitions.
- Click on Add and it will open New Driver Definition dialog box like this. Since i want to connect to Network version of Apache Derby 10.2, i will select it like this
- As you can see when we select the Derby Client JDBC Driver, it is giving an error message "Unable to locate JAR/zip in file system as specified by the driver definition: derbyclient.jar.", that is because Eclipse is not able to find the .jar file containing the database driver for Apache Derby.
- Switch to the Jar list tab like this, on this tab you will notice that derbyclient.jar is already added but it is not pointing to actual file on your machine so remove empty derbyclient.jar and add the derbyclient.jar on your machine like this
- Save your changes and it will take you back to the Driver definitions list, Since i configured only Apache Derby so far, it is listed here. If you want to connect to additional databases configure them over here.
Now once the Database driver is configured, next step is to configure Database connection follow these steps for that.
- Switch to Database development perspective and in the Datasource Explorer view click on New Connection Profile to get Connection Profile dialog like this
- On the next page configure your database connection properties such as DB Name, user id password, same properties as you will use to connect to that database using JDBC.
- After setting properties, click on Test Connection button to verify that your actually able to connect to database. If everything works fine click on Finish
- Once the connection is open you should be will get a view like this, you can use the SQL scrapbook to write one or more query and execute them against the database or you can use database explorer view to explore the database structure.
thanks a lot....it was really very helpful but on clicking on test connection I am getting: ping failed. could u please help me with that.
ReplyDeletethanks.
can u provide me solutions to fetch data from MySQL using RAD v7.5 and Websphere portal v6.1
ReplyDeletethanks a lot
ReplyDeleteDo you have the Derby Server running?
ReplyDeleteIt's quite possible that you are trying to connect to a database without the actual server running on Port 1527.
Try this if you like:
Open a command prompt->
Navigate to your Derby installation directory->
Navigate to the "bin" directory
-> Type "startNetworkServer" and press Enter
You should get a message that says something like this:
2012-08-29 10:57:16.559 GMT : Security manager installed using the Basic server security policy. 2012-08-29 10:57:16.809 GMT : Apache Derby Network Server - 10.6.2.1 - (999685) started and ready to accept connections on port 1527
Do you have the Derby Server running?
ReplyDeleteIt's quite possible that you are trying to connect to a database without the actual server running on Port 1527.
Try this if you like:
Open a command prompt->
Navigate to your Derby installation directory->
Navigate to the "bin" directory
-> Type "startNetworkServer" and press Enter
You should get a message that says something like this:
2012-08-29 10:57:16.559 GMT : Security manager installed using the Basic server security policy. 2012-08-29 10:57:16.809 GMT : Apache Derby Network Server - 10.6.2.1 - (999685) started and ready to accept connections on port 1527
thanks bro @@@
ReplyDeleteIm getting this error when trying to open data source explorer in eclipse for crystal reports ::
ReplyDeleteCould not connect to New Generic JDBC.
Error creating SQL Model Connection connection to New Generic JDBC. (Error: Connection failed with unspecified error.)
Connection failed with unspecified error.
Error creating JDBC Connection connection to New Generic JDBC. (Error: Connection failed with unspecified error.)
Connection failed with unspecified error.
help will b highly appreciated
Thank you so much!!!
ReplyDeleteThe article was really very helpful.:)
Thanks for info....
ReplyDeleteSEO Company in Bangalore