Accessing MYSQL Database Using Java in Eclipse IDE

Stirling Crow · 264K views · 2010 · 9:52

Open on YouTube

Databases & storageTesting, debugging & developer toolstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the beginner tutorial they followed for Java and MySQL setup, usually when asking why their JDBC connection or driver loading fails.

Recommended by 1 people across 1 different months, 2011 to 2012.

What it is

A short 2010 screencast showing how to connect a Java program to a MySQL database from the Eclipse IDE and run queries. It is presented by Stirling Crow as a step-by-step walkthrough of adding the JDBC driver and writing the query code.

What people said

Recommends teynon · 2011-06 · Stack Overflow · on “Java / MySQL on remote server”

Ok, sorry if this question is stupid. I followed this tutorial: [this video] . Now that I have it compiling in Eclipse, when I upload it to a remote server, how do I get it to work with the jdbc library? If I try to execute Main.class on a remote server, I get Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver How do I include the jar or get rid of this error?

Cites HitchCoder · 2012-03 · Stack Overflow · on “Error in running Java Code code ( Unknown character set: 'utf8mb4' )?”

Im trying to learn Java programming and how to link it with Database MySQL ... Here's the Code : import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; public class main { public static void main(String[] args) throws Exception { System.out.println("Loading Driver .."); System.out.println("Loading Driver ..."); System.out.println("Loading Driver ...."); System.out.println("Loading Driver ....."); Class.forName("com.mysql.jdbc.Driver"); System.out.println("Driver Loaded"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost/javabook", "root", "1234"); //Connect System.out.println("Database Connected"); Prepared

Cites MGD · 2012-08 · Stack Overflow · on “Issue accessing MySQL from Java”

I am trying to use MySQL for the first time in Java. I've followed this tutorial [this video] and I'm able to write some code, yet I'm not understanding where I'm going wrong. I get the following message: terminated docsconnectionpropshelper java application The program doesn't even reach the main class where the debug stop point is placed. My code is: public class CDaoAccess implements IDaoAccess { public static Connection connect = null; private Statement statement = null; private PreparedStatement preparedStatement = null; private ResultSet resultSet = null; @Override public void connectDatabase(String _database) throws Exception { // This will load the MySQL driver, each DB has its own driver