Talk:Java Database Connectivity

Latest comment: 7 years ago by VictorSergienko in topic Please please do NOT catch Throwable.

NOT an acronym

edit

JDBC does not stand for "Java Database Connectivity". This is a backronym. See http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/getstart/intro.html#1018464, first paragraph. The main page should be titled JDBC, with Java Database Connectivity redirecting to it. --Nambio 00:11, 29 May 2006 (UTC)Reply

And from the same site, http://java.sun.com/javase/technologies/database/. Sun seems to be contradicting itself for some reason. WP:NAME "[p]refer[s] spelled-out phrases to abbreviations", so even though JDBC is overwhelmingly more popular, the fact that Sun has referred to it as "Java Database Connectivity" mitigates against using the acronym as the page title (see ODBC as a parallel). --DeLarge 23:29, 25 March 2007 (UTC)Reply
I heard it was a trademark issue. In some jurisdictions, you can't trademark an acronym so they had to make JDBC its name, not its acronym. (Northernhenge (talk) 22:37, 5 April 2008 (UTC))Reply

Example is dated

edit

Class.forName("some string"); is back from 1.0 days and while it still works for backwards compatiblity is not preferred. Jon 13:58, 30 March 2007 (UTC)Reply

Type 5

edit

Deleted section on "type 5". There is no clear definition of what a type 5 architecture is, unlike types 1-4. This is not officially terminology adopted through the JCP. It seems to be to be mostly an invention of Progress Software's marketing department.--SJK (talk) 10:51, 30 October 2010 (UTC)Reply

Possible Original Research

edit
===Bad Examples===
The Internet is full of wrong JDBC examples, even Oracle and the acquired SUN keep wrong examples where they clearly show they do not know Java has exceptions and resources must be closed in a finally clause.[1][2][3]
What is the problem with referencing wrong examples? Do you mean every time I add a reference there is original research? —Preceding unsigned comment added by 87.218.251.115 (talk) 13:37, 7 April 2011 (UTC)Reply

This statement appears to come from an analysis of the reference code, which is original research. While well-intentioned, I'm afraid that either this section should be either deleted or better references should be used. --Sbluen (talk) 06:17, 3 April 2011 (UTC)Reply

Seconded, also i think this article reads far too much like a howto SmackEater (talk) 09:08, 4 April 2011 (UTC)Reply


The closing of statements is recommended here. Properly releasing ressouces that were allocated previously is programming basics, no special citations needed here imho. Failure to do so leads to leaks. — Preceding unsigned comment added by 81.7.230.226 (talk) 17:45, 24 January 2013 (UTC)Reply

References

Should extend connection pool examples

edit

Now: "Examples of connection pools include BoneCP, C3P0 and DBCP" Should add https://github.com/brettwooldridge/HikariCP and maybe deprecate C3PO (and DBCP?), — Preceding unsigned comment added by 84.48.115.70 (talk) 12:04, 1 April 2015 (UTC)Reply

Please please do NOT catch Throwable.

edit

To an anonymous 194.176.105.142. While your link in diff 698792584 contains a moderately bad advice to catch a general Exception, which is only suitable for simplistic examples and not for production, catching Throwable is a huge mistake. Please read: http://stackoverflow.com/questions/2274102/difference-between-using-throwable-and-exception-in-a-try-catch — Preceding unsigned comment added by VictorSergienko (talkcontribs) 11:32, 21 September 2016 (UTC)Reply

Please, see: http://stackoverflow.com/questions/34664936/should-i-catch-all-exceptions-or-just-sqlexception-when-closing-jdbc-resources-o and https://github.com/spring-projects/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java Jsmithgeorge (talk) 19:36, 8 December 2016 (UTC)Reply
Please note that a) the answer you refer to has 0 upvotes; b) it catches Exception, not Throwable; c) even that answer says "Just make sure to pass along everything you don't know how to handle (so the caller has to)". CAN you really handle OutOfMemoryError in your catch (Throwable)? InternalError? UnknownError? d) I don't even think that Spring code knows what it is doing. Looking forward to a better code example from you, which does handle these. DOES this example need to handle IllegalClassFormatException? I highly doubt. Please don't teach people to catch what they don't know how to handle. The rule is: you ONLY catch those that you know what to do with. A reference to Oracle docs: "This feature can reduce code duplication and lessen the temptation to catch an overly broad exception." VictorSergienko (talk) —Preceding undated comment added 17:51, 15 December 2016 (UTC)Reply
Also read: Java API documentation: "An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch." — Preceding unsigned comment added by VictorSergienko (talkcontribs) 18:13, 15 December 2016 (UTC)Reply