KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sellwin > db > JDBC


1 package sellwin.db;
2
3 // SellWin http://sourceforge.net/projects/sellwincrm
4
//Contact support@open-app.com for commercial help with SellWin
5
//This software is provided "AS IS", without a warranty of any kind.
6

7
8 /**
9  * a simple JDBC helper-utility class
10  */

11 public class JDBC {
12     /**
13      * build a quoted string for use with JDBC when building
14      * dynamic sql
15      * @param s the string we wish to quote
16      * @return the quoted string
17      */

18     public static String JavaDoc quote(String JavaDoc s) {
19         return "'" + s + "'";
20     }
21
22     /**
23      * same as quote() except with a comma added on the end
24      *
25      * @see quote
26      */

27     public static String JavaDoc quoteMore(String JavaDoc s) {
28         return "'" + s + "',";
29     }
30 }
31
Popular Tags