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.
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