mysql> select * from demo_people;
+------------+--------------+------+
| name | phone | pid |
+------------+--------------+------+
| Mr Brown | 01225 708225 | 1 |
| Miss Smith | 01225 899360 | 2 |
| Mr Pullen | 01380 724040 | 3 |
+------------+--------------+------+
3 rows in set (0.00 sec)
mysql> select * from demo_property;
+------+------+----------------------+
| pid | spid | selling |
+------+------+----------------------+
| 1 | 1 | Old House Farm |
| 3 | 2 | The Willows |
| 3 | 3 | Tall Trees |
| 3 | 4 | The Melksham Florist |
| 4 | 5 | Dun Roamin |
+------+------+----------------------+
5 rows in set (0.00 sec)
f I do a regular JOIN (with none of the keywords INNER, OUTER, LEFT or RIGHT), then I get all records that match in the appropriate way in the two tables, and records in both incoming tables that do not match are not reported:
mysql> select name, phone, selling
from demo_people join demo_property
on demo_people.pid = demo_property.pid;
+-----------+--------------+----------------------+
| name | phone | selling |
+-----------+--------------+----------------------+
| Mr Brown | 01225 708225 | Old House Farm |
| Mr Pullen | 01380 724040 | The Willows |
| Mr Pullen | 01380 724040 | Tall Trees |
| Mr Pullen | 01380 724040 | The Melksham Florist |
+-----------+--------------+----------------------+
If I do a LEFT JOIN, I get all records that match in the same way and IN ADDITION I get an extra record for each unmatched record in the left table of the join - thus ensuring (in my example) that every PERSON gets a mention:
mysql> select name, phone, selling
from demo_people left join demo_property
on demo_people.pid = demo_property.pid;
+------------+--------------+----------------------+
| name | phone | selling |
+------------+--------------+----------------------+
| Mr Brown | 01225 708225 | Old House Farm |
| Miss Smith | 01225 899360 | NULL |
| Mr Pullen | 01380 724040 | The Willows |
| Mr Pullen | 01380 724040 | Tall Trees |
| Mr Pullen | 01380 724040 | The Melksham Florist |
+------------+--------------+----------------------+
If I do a RIGHT JOIN, I get all the records that match and IN ADDITION I get an extra record for each unmatched record in the right table of the join - in my example, that means that each property gets a mention even if we don't have seller details:
mysql> select name, phone, selling
from demo_people right join demo_property
on demo_people.pid = demo_property.pid;
+-----------+--------------+----------------------+
| name | phone | selling |
+-----------+--------------+----------------------+
| Mr Brown | 01225 708225 | Old House Farm |
| Mr Pullen | 01380 724040 | The Willows |
| Mr Pullen | 01380 724040 | Tall Trees |
| Mr Pullen | 01380 724040 | The Melksham Florist |
| NULL | NULL | Dun Roamin |
+-----------+--------------+----------------------+
Wednesday, October 7, 2009
Monday, September 28, 2009
glassfish


glassfish
Glassfish adalah salah Application Server produk Sun Microsystem yang banyak digunakan untuk aplikasi enterprise. Glassfish dapat berdiri sendir maupun dalam sistem cluster.
Langkah-langkah instalasi glassfish di Linux.
1. Download Installer glassfish disini, untuk tutorial ini Saya menggunakan Glassfish versi v2.1-b60e
2. Selanjutnya Setting Environment Java di Linux Anda, Tutorial nya bisa dibaca disini.
3. Kemudian pada tahapan ini, Kita akan melakukan instalasi dengan perintah sebagai berikut:
java -Xmx256m -jar glassfish-installer-v2.1-b60e-linux-ml.jar
256 disini menunjukkan memori yang akan digunakan untuk Glassfish adalah sebesar 256 Mb, jika anda tidak berhasil melakukan penginstalasian dengan perintah diatas, angka 256 bisa diganti dengan 512.
4. Lalu pindah ke Direktori Glass Fish
cd glassfish
5. Tambahkan permission execute pada Software Ant yang include dengan Glassfish
chmod -R +x lib/ant/bin
6. Lakukan Setup Glassfish
Jika Anda ingin menjalankan Glassfish dalam Sistem Cluster Anda jalankan perintah sebagai berikut:
lib/ant/bin/ant -f setup-cluster.xml
Namun jika Anda tidak menginginkan GlassFish berjalan dalam Sistem Cluster jalan perintah berikut:
lib/ant/bin/ant -f setup.xml
7. Sampai Disini GlassFish sudah terinstall dengan domain default yang diberi nama domain1.
8. Untuk melakukan pengecekan terhadap instalasi Glassfish silahkan Anda Buka Web browser anda lalu ketikkan alamat sebagai berikut:
http://localhost:4848
username admin
password adminadmin
Menjalankan Glassfish
wks-384@wks-384:~$ cd glassfishv3/
wks-384@wks-384:~/glassfishv3$ cd bin/
wks-384@wks-384:~/glassfishv3/bin$ ./asadmin start-domain --verbose domain1
Subscribe to:
Posts (Atom)
