-
Notifications
You must be signed in to change notification settings - Fork 0
daoPutFact
tarimshahab edited this page May 22, 2015
·
3 revisions
Related DAO Code
int putFact(Map<String, String[]> params, String app, String fact, List<LookupPair> multiKeys) throws Exception
{
connect();
List<MetaField> metas = getMeta(app, "FACT_"+fact,false);
params = createMultiKeys(metas,multiKeys, params);
conn.setAutoCommit(false);
String sql = buildInsertSql(metas,app,"FACT_"+fact);
PreparedStatement pst = conn.prepareStatement(sql);
for(int i= 0;i<metas.size();i++)
{
if(params.get(metas.get(i).getColumnName())!= null)
{
String enteredData = params.get(metas.get(i).getColumnName())[0];
pst.setString(i+1, enteredData);
}
else
{
pst.setString(i+1,"0");
}
}
System.out.println(sql);
pst.execute();
conn.commit();
conn.setAutoCommit(true);
sql = "select max("+fact+"Key) as id from "+"FACT_"+fact;
ResultSet rs=st.executeQuery(sql);
int rowId= -1;
while(rs.next())
{
rowId=Integer.parseInt(rs.getString("id"));
}
disconnect();
return rowId;
}-
Quickforms Basics
-
Tutorials
- Setup Tutorials
- App Development Tutorials
-
Assignments
-
Project
-
Applications
-
Quickforms Advanced
- Project With Database
- Advanced Setup
- HealthApp with Database
- Source Control
- Joining the Team
- Cordova Native Application
- Miscellaneous
- Project With Database
-
-
Form Controls
-
App Controls
-
Report Controls
-
Server Controls
-
Quickforms DAO
-
Email Notification
-
Migrating QuickForms3(Test Server) to QuickForms(Production-Server)