Tuesday, December 30, 2008

spring and hibernate

tutorials
http://maestric.com/en/doc/java/spring/hello_world
http://www.roseindia.net/spring/index.shtml



http://www.roseindia.net/hibernate/firstexample.shtml

Monday, December 29, 2008

Tuesday, December 23, 2008

Generating Hibernate Mapping Files and POJO Classes with NetBeans

NetBeans 6.5 allows you to automatically generate POJO classes and mapping files as per the database.

Following note is extracted from netbeans Tutotial,

In this tutorial you use a POJO (plain old Java object) to represent the data in each of the tables in the database that you will use. The Java class specifies the fields for the columns in the tables and uses simple setters and getters to retrieve and write the data. To map the POJOs to the tables you can use a Hibernate mapping file or use annotations in the class.

You can use the Hibernate Mapping Files and POJOs from a Database wizard to create multiple POJOs and mapping files based on database tables. When you use the wizard you select all the tables for which you want POJOs and mapping files and the IDE then generates the files for you based on the database tables and adds the mapping entries to hibernate.cfg.xml. When you use the wizard you can choose the files that you want the IDE to generate (only the POJOs, for example) and select code generation options (generate code that uses EJB 3 annotations, for example).

Note. The IDE also has wizards to help you create individual POJOs and mapping files from scratch.

  1. Right-click the Source Packages node in the Projects window and choose New > Other to open the New File wizard.
  2. Select Hibernate Mapping Files and POJOs from a Database in the Hibernate category. Click Next.
  3. Keep the default values in the Name and Location pane. Click Next.
  4. Select hibernate.cfg.xml from the Configuration File drop down list, if not selected.
  5. Select the from Available Tables and click Add to add the tables to Selected Tables.

Thursday, March 27, 2008

Thursday, March 13, 2008

This is what the Sri Lanken Cricket .....


At last it has happened!. Sanath Jayasuriya and Muttiah Muralitharan are not in the one day squad to tour the West Indies at the end of the month. Sanath, it is reported, has been axed from the team while Muralitharan is being rested.

According to a reliable source at Sri Lanka Cricket these decision were taken at a stormy meeting of the SLC Selectors held last night.

http://www.dailymirror.lk/DM_BLOG/Sections/frmNewsDetailView.aspx?ARTID=9058


http://www.dailymirror.lk/DM_BLOG/Sections/frmNewsDetailView.aspx?ARTID=9058
http://www.dailymirror.lk/DM_BLOG/Sections/frmNewsDetailView.aspx?ARTID=8905

If any one want to read others comments,

http://answers.yahoo.com/question/index;_ylt=ApUg2OjBrd_XRLnMBRMXMeNZxQt.;_ylv=3?qid=20080313061113AAfAOgV


Thursday, February 28, 2008

We should protect our heroes

http://www.island.lk/2008/02/25/features1.html

Good article, But I am not agreeing with some of following comments,

In Sanath’s case the impact of age is of an entirely different order. His forearms and wrists, forged in a foundry in Matara have stood the test of time. It is an incontrovertible biological truth that age diminishes the speed of reflexes and the stamina to play a waiting game. A bowler is never undone by bowling one bad ball, but a batsman is always undone by one ball that is unplayable or one that he plays badly. He, therefore, needs fast reflexes as well as stamina to play a waiting game.

yes biological truths are there, but I do not think it affected to Sanath still.
As you can remember Mr Ranil Abenayaka has the same argument 2-3 years before. Sanath has completely undone it by performing well in the VB series (vs Australia) and the England tour. Actually he has given the replies to this kind of journalist with the two150s in the England tour.

Actually we should protects our heroes from this kind of
journalist.

Wednesday, February 27, 2008

My Laptop


A year ago, I brought a Lenovo laptop (3000 N100/0689).

Tuesday, February 26, 2008

Useful Technology Tips

1. How to add TNS listener for the Oracle (10g)
Configuration and Migration Tools --- > Net Configuration Assistant --> Listener configuration --> Add Listener

2. How to drop a database with sql*plus
SQL*Plus: Release 10.1.0.3.0 - Production on Fri Feb 18 20:15:26 2005

Copyright (c) 1982, 2004, Oracle. All rights reserved.

SQL> connect / as sysdba
Connected to an idle instance.
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 612368384 bytes
Fixed Size 790352 bytes
Variable Size 174321840 bytes
Database Buffers 436207616 bytes
Redo Buffers 1048576 bytes

SQL> alter database mount exclusive;

Database altered.

SQL> alter system enable restricted session;

System altered.

SQL> drop database;

Database dropped.

3. How to delete all the tables/views/indexes .. from a database without dropping it.

step1: Create a user and grant permission to the DB
step2: Remove the user then it will automatically remove all the tables and views etc...
(e.g. drop user username cascade;)

Saturday, February 23, 2008

Tour to Pahiyangala


Pahiyangala Where the pre-historic man lived 37,000 years ago.Valuable fossils of the pre-historic man have been found in this pit.
A large rocky mountain loomed before us through the misty morning, when we were proceeding towards the village "Yatagampitiya" 5 km off Bulathsinhala in the Kalutara district, where an early human habitation existed thousands of years ago, today known as "Pahiyangala".

http://www.mysrilanka.com/travel/lanka/history/pahiyangala.htm