javac -classpath %CLASSPATH%;"<Path of required jar files>" *.java
Wednesday, November 7, 2007
Compilation of all java files together including subfolders
Monday, November 5, 2007
Mysql: Retriving Field Names of a Table
In order to retrive field name from the table that matches the search criteria, just do run the following query.
SELECT *, MATCH(Field name 1) AGAINST ('*searchable value*' in boolean mode) as label1,
MATCH(Field name 2) AGAINST ('*searchable value*') as label2, ... FROM table_name
WHERE MATCH(Field name 1, Field name 2, ...) AGAINST ('*searchable value*')
Ex:
SELECT *, MATCH(customers_firstname) AGAINST ('*suresh*') as firstname,
MATCH(customers_lastname) AGAINST ('*suresh*') as lastname,
MATCH(customers_email_address) AGAINST ('*suresh*') as email_address
FROM customers
WHERE MATCH(customers_firstname, customers_lastname,
customers_email_address) AGAINST ('*suresh*').
if you dont want to include in boolean mode then alter the table with index type of "full text". and do the same thing excluding in boolean mode
How to open a hyper link outside of Iframe?
How to open a hyper link outside of Iframe?
If we use target as "_top" in hyperlink tag then the destination url will
open in that same window.
If you don't use target, then the link will be opened within IFrame.
If we use target as "_blank" then the link will be opened in new browser
window.
Jar files missing.
MymeTypesFileTypeMap cannot be resolved -------------- activation.jar
mailSession error --------------------------------------------------- mail.jar,mailplugin.jar
org.apache.struts.taglib.html.BaseHandlerTag error ----- jboss-j2ee.jar
Real time Difference between Interface and Abstract Class
In real time how the abstraction and interface uses when we go for those concept in real time.
Both abstract classes and interfaces are used when there is a difference in behaviour among the sub-types extending the abstract class or implementing the interface.
When the sub-types behaviour is totally different then you use an interface, when the sub-types behaviour is partially common and different with respect to the supertype an abstract class is used. In an abstract class the partially common behaviour is given a concrete implementation. Since there is no common behaviour between an interface and a sub-type an interface does not have an implementation for any of its behaviour.
Lets assume you are developing a framework for a 'killer' competition where the people who participate have to demonstrate their killing skills. Members participating in the competetion have their own ways of killing.
It could be as different as 'using a gun to kill', 'throwing the victim up in the air and kicking his balls when he victim comes down, 'slitting his throat or behaeding the victim'
The expected behaviour here is to 'KILL', though all the members do have that behaviour 'KILL" each member manifests the behaviour in a different way. Since the behaviour manifestation varies from member to member this scenario calls for an interface.
Interface KilingCompetition{
Corpse kill();
}
Each member will implement this interface and give an implementation in his/her own way.
Now, lets consider a karate competition(is it called sparring?). Here each member has to follow certain things as laid out by the organizers or the karate protocol. It may include things like bowing to the opponent before and after the fight starts, taking a stand etc. Now these behaviours are common and has to manifested in the same way by every paticipating member. But the behaviour 'fight' will differ from member to member. So now we have a set of common behaviour and also a behaviour which manifests differently from member to member. this calls for an abstract class where you give implementation to the common behaviour and make the differeing behaviour abstract and hence the class abstract.
public abstract class KarateFight{
public void bowOpponent(){
//implementation for bowing which is common
// for every participant
}
public void takeStand(){
//implementation which is common
// for every participant
}
public abstract boolean fight(Opponent op);
//this is abstract because it differs from
// person to person
}