This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi. I have a connection pool and there is a first level tier of clients which accesses the database. This tier returns a ResultSet to be used by objects in a second level tier. Each element of the second tier, has one static element of the first tier, which is called when an access to the DB is needed. This way I am always reusing the connections to the database. One of the second level clients, performs several selects, all of them using the first level client which gets its ReusltSet cleaned after every execution, when I call the corresponding method. However there seems to be some kind of problem. Somewhere in my code I'm doing this:
I get a runtime exception which says I cannot do getLong(1), without doing next() first, but I am doing that. I don't understand this problem. I'm using BEA Weblogic 6.1 with MSSQL Server 2000. Can anybody help? Thanks.
Sun Certified Programmer for the Java 2 Platform 1.4<p>If I can create, I will make mistakes. If I can learn with them, it must be some kind of art.
What if no results were returned? You should be checking if there are results before retrieving the value...
not sure if this is the problem though. It's hard to tell, when you separate the connection/statement/resultset from each other. The code to the connection may affect your resultset as well as your code to the statements. Jamie