Thread: JDBC / MySQL

  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Rep Power

    JDBC / MySQL

    Here is my Java code:
    import java.sql.*;
    import java.util.*;
    public class MySQL {
    	public static void main(String[] args) {
     		// The call to Class.forName explicitly loads the driver class
            // the following url says that the protocol is jdbc, the 
            // subprotocol is mysql, and our database (thebookdemo) is installed on the machine 
            // anvil
            String url = "jdbc:mysql://dnetv/darrendn";
            // the method DriverManager.getConnection is the only method that a 
            // general programmer needs to use directly. This method establishes a 
            // connection to a database specified by a URL, loginID and password.
            Connection con = DriverManager.getConnection(url, "root", "rajanator");
            // Once a connection has been established we can create an instance 
            // of Statement, through which we will send queries to the database.
            Statement stmt = con.createStatement();
            // The method executeQuery executes a query on the database. The 
            // return result is of type ResultSet which is one or more rows in 
            // this case.
            ResultSet rs = stmt.executeQuery("SELECT name FROM graffiti_wall");
    even with simple code i get lots of errors! when I run it.
    Exeption in thread "main" java.lang.Error: Unresolved compilation problem: out cannot be resolved
    at sun.reflect.NativeConstructorAccessorImple.newInstance0(Native Method)
    at sun.rat sun.reflect.NativeConstructorAccessorImple.newInstance(
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance0(
    at java.lang.reflect.COnstructor.inewInstance(
    at MySQL.main(
    Does anyone have any idea what this cryptic error msg means?

    I do PHP and MySQL development, so this java stuff is quite new to me.

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Rep Power
    the error refer to line 35 of but your source code is less than 35 more...

IMN logo majestic logo threadwatch logo seochat tools logo