/[H9]/trunk/tntnet/dynamic/adm_installation_delete.ecpp
ViewVC logotype

Annotation of /trunk/tntnet/dynamic/adm_installation_delete.ecpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 195 - (hide annotations) (download)
Sat Dec 8 16:47:03 2007 UTC (16 years, 5 months ago) by torben
File size: 741 byte(s)
Use persistant connections / connection pooling for faster db access

1 torben 101 <%pre>
2     #include <tntdb/connect.h>
3     #include <tntdb/connection.h>
4     #include <tntdb/result.h>
5     #include <tntdb/row.h>
6     #include <sstream>
7     </%pre>
8    
9     <%config>
10     dburl;
11     </%config>
12    
13     <%session scope="global">
14     std::string userName;
15     </%session>
16    
17    
18     <%args>
19     int id;
20     int customerid;
21     std::string name;
22     </%args>
23    
24     <{
25    
26     if (userName.size() == 0)
27     {
28     reply.setHeader("Location", "index");
29     return HTTP_MOVED_TEMPORARILY;
30     }
31    
32 torben 195 tntdb::Connection conn = tntdb::connectCached(dburl);
33 torben 101
34     std::stringstream query;
35     query << "DELETE FROM installation WHERE id = " << id;
36    
37     conn.execute(query.str());
38    
39     std::stringstream url;
40     url << "adm_installation_list?customerid=" << customerid << "&name=" << name;
41     reply.setHeader("Location", url.str());
42     return HTTP_MOVED_TEMPORARILY;
43    
44    
45     }>

  ViewVC Help
Powered by ViewVC 1.1.20