MySQL has migrated from MySQL AB (1995 to 2008) to Sun (2008 to 2010) to Oracle (from 27 Jan 2010)
wizard:java graham$ /usr/local/mysql/bin/mysql -uwellho -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.48 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
Java - originated by Sun and release in 1995, is now owned by Oracle too as part of its acquisition of Sun. When I visited the web service page at
http://java.sun.com/webservices/ yesterday, I noted the following text at the base of the page:
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
© 2010, Oracle Corporation and/or its affiliates
What does this all mean?
On one hand, the brining together of MySQL and Java under a single ownership has enhanced the strength of the line between them. JDBC (the way that Java connects to all flavours of databases) ships as a set of manager classes only, and you need to download / install the actual drivers youself. In much earlier days, those were from a third party site and the class was loaded as follows into a Java application:
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
but the the support was taken up by the MySQL folks, and now that's a part of Oracle - I downloaded the drivers from dev.mysql.com yesterday, and now load them as follows into my Java appliaction:
Class.forName("com.mysql.jdbc.Driver").newInstance();
But on the other hand, I have no crystal ball and I cannot tell you where the Java and MySQL products will be taken; all I can do is to reproduce (for your own review) the text above and suggest that you follow through Oracle's communications if you wish, and that you factor in - as you feel appropriate - all of this information in any decision making with regard to future projects.
You may see my updated "Hello MySQL and Java World" example - which selects data from a database and displays it to the screen -
[here]. I've added a whole load of annotation to that example, including test runs and an analysis of standard error messages (and possible solutions) such as:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
and
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The original example (but I have modernised the class load call) is
[here] and for comparison we have a similar example that connects to an Oracle database
[here].
[If you're looking to use MySQL from within Java from within a JSP (Java Server Page), there's a source code example of the class that we use on our
Deploying Apache httpd and Tomcat training course [here] (we also cover programming Java Server Pages on some of our
Java Courses).]
(written 2010-07-09)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
S050 - MySQL - General [2053] What a difference a MySQL Index made - (2009-02-25)
[2085] MySQL - licensing issues, even with using the name - (2009-03-16)
[2134] Oracle take over Sun who had taken over MySQL - (2009-04-21)
[2240] How do I query a database (MySQL)? - (2009-06-15)
[2426] Which version of MySQL am I running? - (2009-09-26)
[2559] Moving the product forward - ours, and MySQL, Perl, PHP and Python too - (2010-01-01)
[2561] The future of MySQL - (2010-01-03)
[2567] Extra MySQL course dates (2 day course, UK) - (2010-01-08)
[3361] Blowing our own trumpet - MySQL resources - (2011-07-18)
J811 - Java - JDBC - Relational Database Access [515] MySQL - an FAQ - (2005-12-03)
[2154] Bean Classes in Java and Java Database Connections - (2009-05-02)
[3046] Java Beans, tag libraries and JSPs - what and why. - (2010-11-13)
J050 - Java - General [2087] Comparing Java Courses - what can we do? - (2009-03-17)
[2091] C, C++ and C# ... Java and JavaScript - (2009-03-20)
[2114] Which Version of Java am I running? - (2009-04-02)
[2417] Java Programming Fundamentals - (2009-09-24)
[2420] Exceptions in Java - why and how - (2009-09-24)
[2504] Learning to program in ... - (2009-11-15)
[3573] New in Java 7 - and why we are not running public Java 7 courses - (2012-01-08)
[4305] Learning to program in Java - yes, we can help. - (2014-09-26)
[4317] Java - an update of the basics - (2014-11-16)
[4412] Java -making sure you have the right versions - (2015-02-02)
[4430] The spirit of Java - delegating to classes - (2015-02-18)
Some other Articles
Relationships between Java classes - inheritance, packaging and othersChanging with weather and seasonsWriting a server in Java Fail Safe Error Handling in Java via ExceptionsMySQL and Java - connectivity past, present, and future thoughtsWhat methods are available on this Java object?Using java, javac, jar, and CLASSPATH - a simple exampleThe healthy option - away from the private carPark and Ride at Batheaston - will it solve Wiltshires Ills?Two sides of the coin