Click here to Skip to main content
15,885,659 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello everyone,

I am taking an interesting error message. I couldn't find a solution. I want to update some fields in database via textbox.

Java
private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {                                          
        try {
            //1.Kısım Baglantı Saglıyoruz
            this.host = "jdbc:derby://localhost:1527/EMRE";
            this.Name = "emre";
            this.Pass = "2561";
            Connection con = DriverManager.getConnection(host,Name,Pass);
             
            //2.Kısım Statement Olusturuyorum
            
            Statement cumle = con.createStatement();
            String query = "SELECT * FROM P_LOGIN";
            ResultSet rs = cumle.executeQuery(query);
            
            while(rs.next())
            {
            rs.updateString("SIFRE", txtAddUserPassWord.getText());
            rs.updateString("KULLANICI_ADI",txtAddUserName.getText());
            rs.updateString("ROLE",cmbAddUserRole.getSelectedItem().toString());
            JOptionPane.showMessageDialog(null,txtAddUserName.getText()+ "has been updated" );
            
            
            }


Everything is ok but at runtime I am taking an error which is;

"Update String Not Allowed because Result Set is not an Updatable Result Set"

Do you have any solution?
Posted

1 solution

 
Share this answer
 
Comments
FoxRoot 7-Aug-12 8:03am    
Thanks best ever teacher :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900