Saturday, October 23, 2010

Connecting Derby database with RAD 7.0


In the Database Explorer view, connections can be made to a list of supported relational databases. Some of the supported databases are IBM Cloudscape, IBM DB2 Universal Database, Derby, MySql, Microsoft SQL Server, Sybase Enterprise Systems, and Oracle Database. Refer to the product help for a complete list of the supported databases.
In this step, create a database connection to a Derby database that is shipped with Application Developer. A Derby database can use any file system folder as a database. You do not need to create the database before trying to establish a connection. If you select Create the database if required, the Derby database is created before the connection is established.
Derby accepts only one database connection at a time. For example, if a WebSphere Application Server is already connected to the Derby database, an attempt to make a connection from the Database Explorer will fail.
To create a Derby connection:
  1. If the server is running, stop it now or you cannot establish a database connection.
    In the Servers view, right-click on WebSphere Application Server v6.1 and select Stop.
  2. Switch to the Data perspective. Select Window > Open Perspective > Other. Select the Show all check box and select Data. Click OK. Select OK if asked to enable the Core Database Development capability.
  3. Right-click Connections in the Database Explorer view, in the bottom left of the perspective, and click New Connection.
  4. Select Derby 10.1 as shown in Figure 16.
  5. Enter any file system directory in the Database location, for example C:\HelloWorldSeries\AddressDB. You do not have to physically create the folder in the file system; just type in a new folder name.
  6. Click Browse to select the class location. Browse to \runtimes\base_v61\derby\lib\derby.jar as the class location.
  7. Make sure the Create the database if required box is checked. If it is, the tool sets up the Derby database at that location. Because Derby is a test database, you do not need a user ID and password to connect to it. Enter any user ID in the user information section.
  8. Click Test Connection to see if a connection can be established. You should see a window saying the connection is successful. Click Finish to create the connection. If it returns an error stating the user name is invalid, leave both user ID and password blank.

    Figure 16. Creating a Derby database connection 
    Figure 17: Create a Derby database connection
  9. The connection AddressDB is displayed in the Database Explorer view. Expand the connection to see AddressDB, as shown below.


    Figure 17. Database Explorer AddressDB connection 
    Figure 18: Database Explorer AddressDB connection
Right now, the database is empty. Use the Data Project Explorer view to create a data model that contains schema and tables. A data model represents relational data objects that may or may not exist in the database. Later in this exercise, the data model will be deployed to an actual database.
  1. In the Data perspective's Data Project Explorer view, right-click New and click Project.
  2. Select Data > Data Design Project > Next.
  3. Type MyDataProject as the project name and click Finish.
  4. Right-click MyDataProject and click New > Physical Data Model.


    Figure 18. Creating a physical data model 
    Figure 19: Creating a physical data model
  5. Select Derby as the Database and 10.1 as the version. Click Finish.
  6. Expand MyDataProject > Data Models > Database Model.dbm > Schema
  7. Create a table named AddressTable. Right-click on the Schema > Add Data Object > Table. A default table named Table1 is created.

    Figure 19. Creating a table 
    Figure 20: Create a table
  8. Select Table1 and go to the Properties view. Change the following:


    Figure 20. Modifying table name 
    Figure 21: Modifying table name
  9. Switch to the Columns tab in the Properties view.
  10. Click New to add a column. Enter id as the column name. Click the Primary Key check box and select INTEGER as the column type.
  11. Click New. Enter name as the column name. Select VARCHAR as the column type. Change the string length to 100.
  12. Click Add Another. Enter address as the column name. Select VARCHAR as the column type. Change the string length to 200.
  13. Save the file.


    Figure 21. Table columns for AddressTable 
    Figure 22: Table Columns for AddressTable
  14. In the Data Project Explorer, right-click the newly created AddressTable and click Generate DDL. Click Next three times, accepting all the default values. This generates a DDL file named script.sql that can be executed to create the AddressTable in the database.
  15. Right-click script.sql under the SQL Scripts folder and select Run SQL. This will create the AddressTable in the Derby database.


    Figure 22. Run SQL 
    Figure 23: Run SQL
  16. Select the Use an existing connection option. Select AddressDB as the database connection. Click Finish.

    Figure 23. Run SQL wizard 
    Figure 24: Run SQL wizard
  17. Expand your connection until you see the Tables folder. You'll see the AddressTable you just created.


    Figure 24. After the schema definition is deployed 
    Figure 25: After the schema definition is deployed 

Deployment descriptor of web module cannot be loaded error message in RAD

This issue can be solved with the following steps:

    1. Open the application.xml in your Enterprise Application project which contains MyModule.war
    2. Open the Module tab, select web module mentioned in the Problemsview. In this case MyModule.war.
    3. Click Remove... and then save
    4. Click Add... and choose MyModule.war
    5. Save application.xml

Saturday, September 18, 2010

Free Software Downloads (full version)

This site has most of the full version softwares and drivers downloadable free of cost..

                                            http://www.filehippo.com/


Oracle Database 10g Documentation Library

Here you can research new information, look up reference information, and search across the entire Oracle Database 10g Documentation library.


                            http://www.oracle.com/pls/db102/homepage

Thursday, September 16, 2010

Saturday, July 17, 2010

A scene from my friend’s life

He reached his college gate. It was quite a long walk from there to his class room. The same thought was running in his mind. That he could see his friend atleast today. She was from a different department and he had hardly seen her for the past one month. With these thoughts running in his mind he started walking towards his class. The road to his class was filled with trees on both sides. A gentle breeze was blowing  inspite of the scorching sun. His eyes were doing a linear search in an attempt to find her in some part of the road. If he sees her then it will be a great feeling for him for the rest of the day. Else it is just another day at the college. Nothing to lose though.
As the search was going on, at about 20 meters in front of him he saw a girl with a pony tail. A question popped in his mind ‘why can’t it be her??’. A smile evoked in his face. He started to walk fast to reach her. He was approaching the girl all the time walking at a brisk pace (with a gentle jog sometimes). At about 10 meters from her he recognized  the blue salwar she was wearing. It was the dress which she was wearing the 1st day he got introduced to her. More joy for him . It was a great chance for him to see her and have a chat with her. With these happy thoughts running through his mind he started walking with more vigor towards his destination(the girl :P). He immediately took his mobile and messaged her “hi..turn back!!”.
 He even started planning what to speak to her. ‘hey hi, how are u?? ‘, ‘what a surprise to see you!!.’.. and many such starters. Finally he decided to go with his instincts rather than pre-planned dialogues.
Now he was just a yard from the girl. His lips were ready to say a ‘hi’. His mind was set to speak to her. Now he was in line with her. He turned to see her face and tell a ‘hi’. But she just stared at him with a strange look and continued to walk. It was not her. With a heavy heart he had to accept the fact ‘Just another day at the college’. He was tired of walking very fast. He stopped there to drink some water from his bottle. While he was having water, he was consoling himself thinking ‘It’s ok..atleast I saw a new girl today ’

Translate This Page

My Mom's blog

If u are a person interested in crafts and fabric stuffs pls check out this link.. http://www.fabriccraft.blogspot.com/

Blog Rankings

Personal Blogs - Blog Rankings