org.brains2b.sql
Class SQLHelper

java.lang.Object
  extended by org.brains2b.sql.SQLHelper

public final class SQLHelper
extends java.lang.Object

[Short description] [Long description]

Version:
0.11.3 [17-10-2007]
Author:
dennis@brains2b.nl

Constructor Summary
SQLHelper()
           
 
Method Summary
static java.lang.String encode(java.lang.String s)
          encode a String so it can be inserted into an SQL database by replacing every quote with two quotes
static java.lang.String limitIdentifier(java.lang.String s, int length)
          limit the identifier given by String to the length given.
static java.lang.String stripQuotes(java.lang.String s)
          strip quotes from the beginning and end of a String from an SQL database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLHelper

public SQLHelper()
Method Detail

encode

public static final java.lang.String encode(java.lang.String s)
encode a String so it can be inserted into an SQL database by replacing every quote with two quotes

Parameters:
s - String, the String to encode
Returns:
String, the encoded String

stripQuotes

public static final java.lang.String stripQuotes(java.lang.String s)
strip quotes from the beginning and end of a String from an SQL database

Parameters:
s - String, the String to strip
Returns:
String, the stripped String

limitIdentifier

public static final java.lang.String limitIdentifier(java.lang.String s,
                                                     int length)
limit the identifier given by String to the length given.

This is accomplished by removing as much non-vowels as needed from the String

Parameters:
s - String, the identifier to limit
length - int, the length to limit the identifier to
Returns:
String