4
Contributors
8
Replies
35
Views
2 Years
Discussion Span
Last Post by JamesCherrill
Featured Replies
  • The definitive Oracle tutorials are kept up to date, and include MySQL... http://docs.oracle.com/javase/tutorial/jdbc/index.html AFAIK there were no significant SQL-related changes in JDK 8. Read More

0

Code is always the same because Java take care of backward compatibility.
Here you have tutorial about connection to database.
They explain every line of code what is made for.
Read that and I think you will not have any problems in future.
Kind regards, Mike.

0

my advice: learn to write your persistency code in such a way that it's not db dependent. it's much easier to work if on changing a db, all you need to do is change one single property, and not your actual code.

0

^ like he said.
For learning, unles you are already a MySQL admin fiend, I can recommend using the JavaDB that came with your JDK, and NetBeans which has support for JavaDB burned in to its "services" tab. Setting up a database server isn't trivial unless you already know how how to do it. Using NetBeans/JavaDB will enable you to concentrate on your Java. Later you can change the connect statement to work with MySQL or whatever - the rest of the Java SQL support is database-independent.

0

Just saw milil's post -
Beware that tutorial if you want current info. It starts with classForName, which became obsolete in 2006 (if not earlier).
Telling you to use classForName is a dead give-away for a tutorial that's not been updated for years and years.

0

I figured I would use the Oracle tutorials as that would be the most official, and probably up to date tutorial.

I already have a MySQL server running a database and tables set up. I appreciate the advice however.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.