Wednesday, February 14, 2007

Daily Learning

Each day (or each week ( or each year ) ) , I'll try to post a new learning: something new that I've learned or discovered ... It will be probably in software or in life .

At the end of my life, I'll compile this blog into a book, style Je Me Souviens, of Georges Perec

I'll try to do it in english ( or in french ( or in hebrew ) ) ...

Remote debugger

I already knew that we can attach a debugger ( like Eclipse Debugger) to a remote JVM, as long as it's based on an application server ( J2EE like JBoss etc ).
I've learned today that, very easily, we can also debug a simple Java application ( J2SE) using the following arguments:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044

And here are the explanation of the arguments, as I found them in this jacoozi thinking solutions site


The jdb parameters specify the way debugger will operate. For instance transport=dt_socket instructs the JVM that the debugger connections will be made through a socket while the address=1044 parameter informs it that the port number will be 1044. Similarly, if you substitute suspend=y, the JVM starts in suspended mode and stays suspended until a debugger is attached to it. This may be helpful if you want to start debugging as soon as the JVM starts.


For the Eclipse Remote Debugger option, you can have a glimpse here or here.

SQL Tips

Select disctinct


How to count distinct rows within table

select count(*) from ( select distinct d1, d2, d3 , d4, d5, d6, d7, d8, d9 from in_all )


Update/Insert table


How to pass data from table to table:

For ex: pass data from table_b to table_a
truncate table TABLE_A
insert into TABLE_A select * from TABLE_B
truncate is different than the delete from TABLE command. My colleagues says that truncate command s faster ...