This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes DataSource passing param Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "DataSource passing param" Watch "DataSource passing param" New topic
Author

DataSource passing param

smitha rai
Greenhorn

Joined: Jun 29, 2001
Posts: 18
I have concerns over passing DataSource object in a method. Rather, can the client (ClassA) create a datasource object and pass it to other method (in a classB)?

Thanks in advance,

Example:

public classA {

public static List getData() {
return new ClassB().getData(createDataSource());
}

private static DataSource c{
//Create a datasource object (ds) based on the
//database connection parameters
return ds
}

} //classA

public classB {
public List getData(DataSource ds) {
//Establishes connection gets the
//resutset and processes it and
//returns a List of data
}
} //classB
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: DataSource passing param
 
Similar Threads
Q about UML Distilled: transient relationship?
Scope and classes/methods
q from overalltesting.com
How to access another class having private constructor using it's static variavble ?
NullPointer exception