anyone have a link? I want to display data on the GUI that I made using NETBEANS..
I started learning java today,

I got error non-static variable jTextField1 cannot be referenced from a static context.

Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sample", "", "");

      Statement stmt = (Statement) con.createStatement();
      String select = "SELECT name FROM sample WHERE name LIKE text";

Error can be because JTextfield is defined outside static class "like main class". and u are accessing it in static class. In short you cant place non static variable in static functions.

I actually dont sure about you problem. But I have done a similar code in Neatbean. In my code I have wight the SQL statement like below.

String SQL = "SELECT * FROM sample "; 
Statement stmt =  con.createStatement();
 stmt = con.createStatement();
            rs = stmt.executeQuery(SQL);
 jTextField1.setText(rs.getString(String.valueOf("column name from SQL table")));

Thank you.

String.valueOf("column name from SQL table")


Yes, but why? String.valueOf(someString) is just someString. The method does nothing.