pass the provided test and add support for tab and form feed
@@ -76,7 +76,7 @@ public final class SQLServerParameterMetaData implements ParameterMetaData {
*/
/* L2 */ private String parseColumns(String columnSet,
String columnStartToken) {
- StringTokenizer st = new StringTokenizer(columnSet, " =?<>!", true);
+ StringTokenizer st = new StringTokenizer(columnSet, " =?<>!\r\n\t\f", true);
final int START = 0;
final int PARAMNAME = 1;
final int PARAMVALUE = 2;
@@ -330,7 +330,7 @@ public final class SQLServerParameterMetaData implements ParameterMetaData {
String fullName;
nameFragment = firstToken;
// skip spaces
- while (" ".equals(nameFragment) && st.hasMoreTokens()) {
+ while ((0 == nameFragment.trim().length()) && st.hasMoreTokens()) {
nameFragment = st.nextToken();
}
fullName = nameFragment;
@@ -369,7 +369,7 @@ public final class SQLServerParameterMetaData implements ParameterMetaData {
*/
private MetaInfo parseStatement(String sql,
String sTableMarker) {
- StringTokenizer st = new StringTokenizer(sql, " ,\r\n", true);
+ StringTokenizer st = new StringTokenizer(sql, " ,\r\n\t\f(", true);
/* Find the table */
@@ -412,7 +412,7 @@ public final class SQLServerParameterMetaData implements ParameterMetaData {
* @throws SQLServerException
*/
private MetaInfo parseStatement(String sql) throws SQLServerException {
- StringTokenizer st = new StringTokenizer(sql, " ");
+ StringTokenizer st = new StringTokenizer(sql, " \r\n\t\f");
if (st.hasMoreTokens()) {
String sToken = st.nextToken().trim();
