Moved Ray's safeJigger into JDBCUtil so it can be shared with the world.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1566 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -25,6 +25,7 @@ import java.sql.*;
|
||||
|
||||
import com.samskivert.Log;
|
||||
import com.samskivert.io.PersistenceException;
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
/**
|
||||
* A repository for JDBC related utility functions.
|
||||
@@ -165,6 +166,15 @@ public class JDBCUtil
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to jigger the specified string so that it's safe
|
||||
* to use in a regular Statement.
|
||||
*/
|
||||
public static String safeJigger (String text)
|
||||
{
|
||||
return StringUtil.replace(jigger(text), "'", "\\'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the table with the specified name exists, false if
|
||||
* it does not. <em>Note:</em> the table name is case sensitive.
|
||||
|
||||
Reference in New Issue
Block a user