0

I'm getting

Error: Main method not found in class jbdc1.Main, please define the main method as:
public static void main(String[] args)

but no error found in class.

package jbdc1;

import java.sql.ResultSet;
import java.sql.SQLException;

public class Main  {

    public static void main(String[] args) throws Exception {

        MSSQLConnect connect = new MSSQLConnect("ASUS\\SQLEXPRESS",1809, "sa", "123456", "data0");

        ResultSet result = connect.excuteQuery("Select * From Table_1");
        System.out.println(CountRow(result));

        result = connect.excuteQuery("Select * From Table_1 ");
        System.out.println(CountRow(result));
        connect.Close();

    }
    protected static int CountRow(ResultSet result) throws SQLException {
        int count=0;
        while (result.next()) {
            count++;
        }
        return count;
    }

}
4

0 回答 0