Reputation: 35
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
Reputation: 1657
You may need to change the statement creation to look more like this:
st = getDBTransaction().createStatement(sql, 0);
Upvotes: 1
Reputation: 2192
Use your View Objects (based on Entity Ojects) to perform all DML actions.
Upvotes: 0