Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Which databases are the most used with Java Date: Tue, 15 Aug 2017 14:41:49 +0200 Organization: Decebal Computing Lines: 34 Message-ID: <877ey5ngtu.fsf@munus.decebal.nl> References: <87y3qovwjb.fsf@munus.decebal.nl> <87tw1bx2c9.fsf@munus.decebal.nl> <87a833wzcx.fsf@munus.decebal.nl> <87pobz9yv5.fsf@munus.decebal.nl> <87h8x9pfi8.fsf@munus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="72fb8bea0235c6b94245dccb186de60d"; logging-data="16573"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180HWeIIz8GbbhkqaB4ah+pNDA6/t2SSUc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:la15KPMlT3e49YLMq4PFTbJYEV4= sha1:laVqbnqiP3cQxGM+p6kGs+EMhKY= Xref: csiph.com comp.lang.java.programmer:37234 Patrick Roemer writes: > Responding to Cecil Westerhof: >> Earlier I was told that the way to do things was something like: >> try (Statement stmtOldest = conn.createStatement(); >> ResultSet rsOldest = stmtOldest.executeQuery(OLDEST_USED) >> Statement stmtNewest = conn.createStatement(); >> ResultSet rsNewest = stmtNewest.executeQuery(OLDEST_USED) >> Statement stmtCount = conn.createStatement(); >> ResultSet rsCount = stmtCount.executeQuery(OLDEST_USED)) { > > Sure about that? I haven't seen any such suggestion in recent threads. > To the contrary, more than once you have been advised to reuse one > statement to create multiple result sets in sequence. Yes I am sure about that. But probably another thread. > You seem to insist on Statement being an evil ploy designed by the JDBC > inventors to force you to write unnecessary boiler plate code when all > you want is just a ResultSet. Whatever follows from this line of > reasoning is not likely to be correct or useful, I'm afraid. I do not see Statement as an evil ploy. But I think that with try with resources it is something you do not need explicit anymore. If you do not like what I am making, nobody forces you to use it. And even if it is useless, I am learning while making it. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof