Mohit Joshi
Mohit Joshi

Reputation: 15

populating jtable with sql server database

public InventoryJFrame() throws ClassNotFoundException {
    try {
        initComponents();
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver" );
        StringstringCon="jdbc:sqlserver://AAYANPC;databaseName=Qseal;user=sa;password=123";

        Connection con=DriverManager.getConnection(stringCon);
        Statement state=con.createStatement();
        ResultSet rs=state.executeQuery("select * from Qseal");
        ResultSetMetaData rsmetadata=rs.getMetaData();
        int columns=rsmetadata.getColumnCount();
        DefaultTableMode1 dtm=new DefaultTableMode1();
    }   
    catch (SQLException ex) {

        Logger.getLogger(InventoryJFrame.class.getName()).log(Level.SEVERE, null, ex);
    }
}

i get a error in the line DefaultTableMode1 dtm=new DefaultTableMode1();. The error is "cannot find symbol" and in the hint it says that create a pachkage DefaultTableName in source pack

Upvotes: 1

Views: 109

Answers (1)

Mincong Huang
Mincong Huang

Reputation: 5552

According to What does a “Cannot find symbol” compilation error mean?

A "Cannot find symbol" error is about the identifiers. When your code is compiled, the compiler needs to work out what each and every identifier in your code means.

A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler doesn't understand.

I suppose you have a spelling error when taping DefaultTableModel. It ends with the character l instead of the digit 1.

Upvotes: 1

Related Questions