fr.cnes.sitools.util
Class SQLUtils

java.lang.Object
  extended by fr.cnes.sitools.util.SQLUtils

public final class SQLUtils
extends java.lang.Object

Mysql Utilities

Author:
Ralph Ritoch , method mysqlRealEscapeString rest is m.gond (AKKA Technologies)

Method Summary
static java.lang.String escapeString(java.lang.String str)
          Escape data to protected against SQL Injection
static java.lang.String mysqlRealEscapeString(java.lang.String str)
          Escape string to protected against SQL Injection You must add a single quote ' around the result of this function for data, or a backtick ` around table and row identifiers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mysqlRealEscapeString

public static java.lang.String mysqlRealEscapeString(java.lang.String str)
                                              throws java.lang.Exception
Escape string to protected against SQL Injection You must add a single quote ' around the result of this function for data, or a backtick ` around table and row identifiers. If this function returns null than the result should be changed to "NULL" without any quote or backtick.

Parameters:
str - the string to excape
Returns:
the escaped string
Throws:
java.lang.Exception - if there is an error

escapeString

public static java.lang.String escapeString(java.lang.String str)
                                     throws java.lang.Exception
Escape data to protected against SQL Injection

Parameters:
str - the string to escape
Returns:
the escaped string
Throws:
java.lang.Exception - if something is wrong


Copyright © 2010-2013 CNES. All Rights Reserved.