1 Replies - 2449 Views - Last Post: 10 October 2012 - 12:17 PM Rate Topic: -----

#1 narayanan02  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-October 12

Login Page code in java netbeans application

Posted 10 October 2012 - 12:10 PM

runs this site.']
package college;
[topic=1]
Click me!
[/topic]
	Click me!

import com.mysql.jdbc.Connection;
import java.sql.*;

/**
 *
 * @author Narendiran
 */
public class javaconnect {
    Connection c=null;
[b]    public static Connection ConnectDb(){[/b] //Error Line
    try
    {
    Class.forName("com.mysql.jdbc.Driver");
    Connection c=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/college","root","sa");
    [b]return c;[/b] //Error Line
    }
    catch(Exception e)
    {
    }
    }
            

}


Attached File(s)

  • Attached File  Login.doc (178.5K)
    Number of downloads: 340
  • Attached File  code.doc (38.5K)
    Number of downloads: 214
  • Attached File  error.txt (1.27K)
    Number of downloads: 115


Is This A Good Question/Topic? 0
  • +

Replies To: Login Page code in java netbeans application

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Login Page code in java netbeans application

Posted 10 October 2012 - 12:17 PM

This is not a valid statement

public static Connection ConnectDb()

you have the ; missing and
a variable name cannot have () in it like ConnectDB() should be ConnectDB;

and don't place [ tags ] in your code
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1