Kiki Tsang

Greenhorn
+ Follow
since Apr 06, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kiki Tsang

Hi experts,
I'm new to EJB and I am currently implementing a project using SessionBean + DAO. I want to create a DAOFactory that will return different DAO with connections set in the returned DAO. I want to initialize the DAO Factory with a file containing something similar to the following xml:
<daoFactory>
<dao daoName="daoName1" dataSrcName="datasource1" class="com.company.dao.DAOClass1"/>
<dao daoName="daoName2" dataSrcName="datasource2" class="com.company.dao.DAOClass2"/>
</daoFactory>
where should I do this initialization of the factory (bootstraping)? And is it corret for me to read from a file?
[ May 03, 2004: Message edited by: Kiki Tsang ]
Yes, that's what I think too. But when I compile the class using my j2sdk 1.4.2_04, there is no error.
19 years ago
I got a compilation error (ambiguous at the line square(w)) using eclipse but no error if using javac at command prompt. I wonder what should be the correct answer and why:
public class P082{
public static void main(
String args[]){
new Worker().doOverLoad();
}//end main()
}//end class definition
class Worker{
public void doOverLoad(){
int w = 3;
double x = 4.2;

System.out.println(
new Subclass().square(w) + " " + new Subclass().square(x));
}//end doOverLoad()
}// end class
class Superclass{
public int square(int y){
return y*y;
}//end square()

}//end class Superclass
class Subclass extends Superclass{
public double square(double y){
return y*y;
}//end square()
}//end class Subclass
19 years ago