Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: this is code for delete button,is there any errors??,plz help guys

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post this is code for delete button,is there any errors??,plz help guys

    try {
    Class.forName("com.mysql.jdbc.Driver");
    Connection cc = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/registration", "root", "");
    Statement s = (Statement) cc.createStatement();
    ResultSet r = s.executeQuery("delete from students where nic=" + nic.getText() + "");
    while (r.next()) {

    name.setText(r.getString("Name"));
    phone.setText(r.getString("Phone"));
    email.setText(r.getString("Email"));
    course.setSelectedItem(r.getString("Course"));



    }
    } catch (Exception e) {
    e.printStackTrace();

    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: this is code for delete button,is there any errors??,plz help guys

    Please Edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.

    Can you explain your problem? The code that was posted can't be compiled or executed for testing.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 3
    Last Post: September 3rd, 2012, 11:36 AM
  2. Radio button .. display empty screen ?? plz Help
    By smasm in forum AWT / Java Swing
    Replies: 4
    Last Post: April 7th, 2012, 07:21 PM
  3. Radio button hide based on input..please help guys
    By ravi9999 in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: April 7th, 2012, 06:24 AM
  4. Code is giving an error in console, but there are no errors apparent in the code!
    By JamEngulfer221 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 15th, 2011, 09:30 PM
  5. Replies: 5
    Last Post: December 13th, 2009, 07:10 PM

Tags for this Thread