1
When creating the execute method it generates error at this point rs = stm.executeQuery(sql) what can I do
public void excutaSQL(String sql){
try {
stm=(Statement) conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs = stm.executeQuery(sql);// o erro está neste linha
} catch (SQLException ex) {
Logger.getLogger(Conection.class.getName()).log(Level.SEVERE, null, ex);
}
}
error: cannot find Symbol
rs = stm.executeQuery(sql);
Symbol: method executeQuery(String)
Location: variable stm of type Statement
1 error
import java.beans.Statement;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
Where is the value of your variable
SQL
– R.Santos
What is the error?
– viana
You’re probably importing the library
Statement
ofjava.beans
instead ofjava.sql
. Puts theimport
to check in– Sorack