Q: JDBC ClassNotFoundException I am trying to make a simple java program and trying to implement JDBC over it.
But I am getting an exception ClassNotFoundException com.mysql.jdbc.Driver
Here is the logcat:
Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at vehicles.Vehicles.main(Vehicles.java:43)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)

Here is my java code:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package vehicles;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.jws.Oneway;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Akshay Sood
 */
public class Vehicles extends JFrame{
public static JLabel manfName,cost,modelNo,year,color;

public static JTextField colorTXT,costTXT,yearTXT,modelNoTXT,manfNameTXT;

public static JButton submit,reset;

static String Manufacturer,ModelNo,Year,Color,Cost;

static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost/VEHICLE";
static final String USER = "root";
static final String PASS = "8851";
static ResultSet resultSet;
static Statement statement = null;

    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Connection conn = null;


        Class.forName("com.mysql.jdbc.Driver");
        conn=DriverManager.getConnection(DB_URL,USER,PASS);
        statement = conn.createStatement();

        init();
        JFrame jFrame = new JFrame();
        jFrame.setTitle("Vehicle Registration");
        jFrame.setSize(800, 1600);
        jFrame.setLayout(null);
        jFrame.show();
        jFrame.add(manfName);
        jFrame.add(modelNo);
        jFrame.add(year);
        jFrame.add(color);
        jFrame.add(cost);
        jFrame.add(manfNameTXT);
        jFrame.add(modelNoTXT);
        jFrame.add(yearTXT);
        jFrame.add(colorTXT);
        jFrame.add(costTXT);
        jFrame.add(submit);
        jFrame.add(reset);

    }

    private static void init() {
       manfName  = new JLabel();
        manfName.setText("Manufacturer: ");
        manfName.setBounds(10, 10, 150, 10);


        modelNo = new JLabel();
        year = new JLabel();
        color = new JLabel();
        cost = new JLabel();

        modelNo.setText("Model No :");
        year.setText("Year of Purchase:");
        color.setText("Color:");
        cost.setText("Cost:");

        modelNo.setBounds(10, 40, 150, 10);
        year.setBounds(10, 70, 150, 10);
        color.setBounds(10, 100, 150, 10);
        cost.setBounds(10, 130, 150, 10);

        manfNameTXT = new JTextField();
        modelNoTXT = new JTextField();
        yearTXT = new JTextField();
        colorTXT = new JTextField();
        costTXT = new JTextField();

        manfNameTXT.setBounds(300, 10, 150, 20);
        modelNoTXT.setBounds(300, 40, 150, 20);
        yearTXT.setBounds(300, 70, 150, 20);
        colorTXT.setBounds(300, 100, 150, 20);
        costTXT.setBounds(300, 130, 150, 20);

        submit = new JButton();
        reset = new JButton();

        submit.setText("Submit");
        reset.setText("Reset");

        submit.setBounds(100, 200, 100, 20);
        reset.setBounds(200, 200, 100, 20);
        submit.addActionListener(new ActionListener() {

           @Override
           public void actionPerformed(ActionEvent e) {
               Manufacturer = manfNameTXT.getText().toString();
               ModelNo = modelNoTXT.getText().toString();
               Year= yearTXT.getText().toString();
               Color= colorTXT.getText().toString();
               Cost= costTXT.getText().toString();
               System.out.println(Manufacturer + " " + ModelNo + " " + Year + " " + Color + " " + Cost);
               try {
                   resultSet = statement.executeQuery("insert into vehicle values(" + Manufacturer + "," + ModelNo + "," + Year + "," + Color + ","+Cost+")");
               } catch (SQLException ex) {
                   Logger.getLogger(Vehicles.class.getName()).log(Level.SEVERE, null, ex);
               }
           }
       });




    }



}

I dont know what is going wrong. please help

A: Quick Test Program
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;

public class myTest {

    public static void main(String[] args) {

        Connection con = null;
        Statement st = null;
        ResultSet rs = null;

        String url = "jdbc:mysql://localhost:3306/so_gibberish"; // **** MODIFY db name (my db_name is so_gibberish)
        String user = "username";   // **** MODIFY 
        String password = "my_password";    // **** MODIFY 

        try {
            con = DriverManager.getConnection(url, user, password);
            st = con.createStatement();
            System.out.println("------------------------------");
            rs = st.executeQuery("select version()");

            if (rs.next()) {
                System.out.println(rs.getString(1));
                System.out.println("------------------------------");
           }
            rs = st.executeQuery("select id,myCode from thingws");
            while (rs.next()) {
                System.out.println(rs.getInt(1)+": "+rs.getString(2));
            }
            System.out.println("------------------------------");    

        } catch (SQLException ex) {
            Logger lgr = Logger.getLogger(myTest.class.getName());
            lgr.log(Level.SEVERE, ex.getMessage(), ex);

        } finally {
            try {
                if (rs != null) {
                    rs.close();
                }
                if (st != null) {
                    st.close();
                }
                if (con != null) {
                    con.close();
                }

            } catch (SQLException ex) {
                Logger lgr = Logger.getLogger(myTest.class.getName());
                lgr.log(Level.WARNING, ex.getMessage(), ex);
            }
        }
    }
}

I compile it in a folder (windows or linux)
C:\dev\java8\quick_java_mysql_test>javac myTest.java

C:\dev\java8\quick_java_mysql_test>
 (no errors)

I have a dep folder of dependencies under that folder
 Directory of C:\dev\java8\quick_java_mysql_test\dep

08/26/2015  10:29 AM    <DIR>          .
08/26/2015  10:29 AM    <DIR>          ..
03/17/2015  05:21 AM           968,670 mysql-connector-java-5.1.35-bin.jar
               1 File(s)        968,670 bytes

I run it with a command line classpath (cp) option flag to pick up class and the dep folder too:
C:\dev\java8\quick_java_mysql_test>java -cp ".;dep/mysql-connector-java-5.1.35-bin.jar" myTest

------------------------------
5.6.24-log
------------------------------
Oct 17, 2015 11:35:25 AM myTest main
SEVERE: Table 'so_gibberish.thingws' doesn't exist
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'so_gibberish.thingws' doesn't exist
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:389)
        at com.mysql.jdbc.Util.getInstance(Util.java:372)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2531)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2489)
        at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1446)
        at myTest.main(myTest.java:31)

My classpath variable
not used. My strategy for this one is to have it project specific under the project folder. Others choose other strategies, and I often do with classpath variable.
You can also have a web container such as tomcat and web-inf, etc. 
This is just a quick command line sanity check.
Program output
The program above succeeds on the connect, dumps out the version of mysql, then simply fails on the use of a table that does not exist anymore
If I did not have a good classpath (cp) setup as described when running the program (what @JonSkeet was getting at), then in my case I would have encountered your error.
Edit
Here it is with a classpath environment variable below:
classpath=.;c:\javadeps\*

Output
Same as above, the driver is picked up in my common c:\javadeps
