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) { } } }
Login Page code in java netbeans application
Page 1 of 11 Replies - 39133 Views - Last Post: 10 October 2012 - 12:17 PM
#1
Login Page code in java netbeans application
Posted 10 October 2012 - 12:10 PM
runs this site.']
Replies To: Login Page code in java netbeans application
#2
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
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
Page 1 of 1