el-shaimaa badr
el-shaimaa badr

Reputation: 35

Update SQL statement in ADF

Please I'm creating a page which update username and password

I used this code but it doesn't work

String amdef ="model.firstAppModule";
String config="firstAppModuleLocal";
ApplicationModule ami = Configuration.createRootApplicationModule(amdef, config);
firstAppModuleImpl am = (firstAppModuleImpl)ami;

try{
    String sql="UPDATE Employee SET Username='dddd',Password='ffff' WHERE Id=1";
    Statement st = null;

    st = am.getDBTransaction().createStatement(0);

    st.executeUpdate(sql);
}        
catch(Exception e) {
    System.out.println("exception"+e.toString());
}

Any help please

Upvotes: 1

Views: 1117

Answers (2)

Florin Marcus
Florin Marcus

Reputation: 1657

You may need to change the statement creation to look more like this:

st = getDBTransaction().createStatement(sql, 0);

Upvotes: 1

User404
User404

Reputation: 2192

Use your View Objects (based on Entity Ojects) to perform all DML actions.

Upvotes: 0

Related Questions