I am having a small problem in my implementation of Data Access Object Pattern. I have created a collection of objects in displayTable() method of the AccessTableDAO as shown below. I am calling this method from a servlet to access this Collection of objects and print all the details. However the problem is that i havent been able to. Wat i get is a null Collection(by checkin size). The code of both the servlet and the class creating the Collection is shown below. The other classes are not shown . They have been rechecked many times and can assumed to be logically correct and error free. I feel either there is some problem with the Connection code or something wrong in the try catch block.
Does your query return any results when you run it in a sql client? And why are you using the JDBC-ODBC bridge? DB2 has its own type 4 driver doesn't it? [ April 23, 2008: Message edited by: Paul Sturrock ]
I guess class Table is a standard part of database code so what I see is ( first ) I think we have new tablesist = new ArrayList(); assigned to by the next statement which returns I do not know what but syntax normally would be List tablelist = tabDAO.method() or something. For one thing, I would think a List should go to a list. For another the return type of tabDAO.displayTable() should be consulted. Another thing is that new ArrayList() is (probably) not needed if the code immediately assigns the return from displayTable()
Second,{ ;) }, we need to use correct spelling. I can read this and it is asking a question but we waste time while some sherrif who has better things to do tells us not to use variant spelling.
Correct the above before making any changes to Connection code or the try / catch. We have plenty of masters in conventional database stuff.
[Paul, I was guessing. You know more about this so just delete this if non-productive. Nick] [ April 23, 2008: Message edited by: Nicholas Jordan ]
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."