KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > transactions > security > InsertStyle


1 package transactions.security;
2
3 import dinamica.*;
4
5 /**
6  * Insert stylesheet into DB using prepared statement
7  * <br><br>
8  * (c) 2004 Martin Cordova<br>
9  * This code is released under the LGPL license<br>
10  * Dinamica Framework - http://www.martincordova.com
11  * @author Martin Cordova (dinamica@martincordova.com)
12  * */

13 public class InsertStyle extends GenericTransaction
14 {
15
16     /* (non-Javadoc)
17      * @see dinamica.GenericTransaction#service(dinamica.Recordset)
18      */

19     public int service(Recordset input) throws Throwable JavaDoc
20     {
21
22         //list and order of parameters for prepared statement
23
String JavaDoc[] params =
24         {
25             "title",
26             "css_code"
27         };
28
29         //create sql template
30
String JavaDoc sql = getSQL(getResource("insert.sql"), input);
31
32         //exec prepared statement
33
Db db = getDb();
34         db.exec(sql, input, params);
35
36         return 0;
37
38     }
39
40 }
41
Popular Tags