提交 7933ae85 编写于 作者: A alanb

Merge

...@@ -4042,7 +4042,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -4042,7 +4042,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
case java.sql.Types.CHAR: case java.sql.Types.CHAR:
case java.sql.Types.VARCHAR: case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR: case java.sql.Types.LONGVARCHAR:
return new String(srcObj.toString()); return srcObj.toString();
default: default:
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString()+ trgType); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString()+ trgType);
} }
...@@ -4139,7 +4139,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -4139,7 +4139,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
case java.sql.Types.CHAR: case java.sql.Types.CHAR:
case java.sql.Types.VARCHAR: case java.sql.Types.VARCHAR:
case java.sql.Types.LONGVARCHAR: case java.sql.Types.LONGVARCHAR:
return new String(srcObj.toString()); return srcObj.toString();
default: default:
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
} }
...@@ -6434,7 +6434,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern ...@@ -6434,7 +6434,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
if (tabName == null) if (tabName == null)
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.tablename").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.tablename").toString());
else else
tableName = new String(tabName); tableName = tabName;
} }
/** /**
......
...@@ -1106,7 +1106,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C ...@@ -1106,7 +1106,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
public void updateBytes(int columnIndex , byte []x) throws SQLException { public void updateBytes(int columnIndex , byte []x) throws SQLException {
boolean bool; boolean bool;
String val = new String(); String val = "";
Byte [] obj_arr = new Byte[x.length]; Byte [] obj_arr = new Byte[x.length];
......
...@@ -876,8 +876,8 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { ...@@ -876,8 +876,8 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
String strWhereClause = "Select "; String strWhereClause = "Select ";
String whereClause; String whereClause;
String tabName= null; String tabName= "";
String strTabName = null; String strTabName = "";
int sz,cols; int sz,cols;
int j; int j;
CachedRowSetImpl crs; CachedRowSetImpl crs;
...@@ -891,8 +891,6 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet { ...@@ -891,8 +891,6 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
// tableNameX.(rowsetX.getMatchColumnName()) == // tableNameX.(rowsetX.getMatchColumnName()) ==
// tableNameZ.(rowsetZ.getMatchColumnName())); // tableNameZ.(rowsetZ.getMatchColumnName()));
tabName = new String();
strTabName = new String();
sz = vecRowSetsInJOIN.size(); sz = vecRowSetsInJOIN.size();
for(int i=0;i<sz; i++) { for(int i=0;i<sz; i++) {
crs = (CachedRowSetImpl)vecRowSetsInJOIN.get(i); crs = (CachedRowSetImpl)vecRowSetsInJOIN.get(i);
......
...@@ -541,7 +541,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable { ...@@ -541,7 +541,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
// how many fields need to be updated // how many fields need to be updated
int colsNotChanged = 0; int colsNotChanged = 0;
Vector cols = new Vector(); Vector cols = new Vector();
String updateExec = new String(updateCmd); String updateExec = updateCmd;
Object orig; Object orig;
Object curr; Object curr;
Object rsval; Object rsval;
...@@ -1184,7 +1184,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable { ...@@ -1184,7 +1184,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
// trim all the leading and trailing whitespaces, // trim all the leading and trailing whitespaces,
// white spaces can never be catalog, schema or a table name. // white spaces can never be catalog, schema or a table name.
String cmd = new String(); String cmd = "";
catalog = catalog.trim(); catalog = catalog.trim();
schema = schema.trim(); schema = schema.trim();
......
...@@ -641,7 +641,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable { ...@@ -641,7 +641,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
return null; return null;
} }
char []charStr = s.toCharArray(); char []charStr = s.toCharArray();
String specialStr = new String(); String specialStr = "";
for(int i = 0; i < charStr.length; i++) { for(int i = 0; i < charStr.length; i++) {
if(charStr[i] == '&') { if(charStr[i] == '&') {
......
...@@ -441,9 +441,9 @@ public class XmlReaderContentHandler extends DefaultHandler { ...@@ -441,9 +441,9 @@ public class XmlReaderContentHandler extends DefaultHandler {
updates = new Vector(); updates = new Vector();
// start out with the empty string // start out with the empty string
columnValue = new String(""); columnValue = "";
propertyValue = new String(""); propertyValue = "";
metaDataValue = new String(""); metaDataValue = "";
nullVal = false; nullVal = false;
idx = 0; idx = 0;
...@@ -686,7 +686,7 @@ public class XmlReaderContentHandler extends DefaultHandler { ...@@ -686,7 +686,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
} }
// propertyValue need to be reset to an empty string // propertyValue need to be reset to an empty string
propertyValue = new String(""); propertyValue = "";
setTag(-1); setTag(-1);
break; break;
case METADATA: case METADATA:
...@@ -710,7 +710,7 @@ public class XmlReaderContentHandler extends DefaultHandler { ...@@ -710,7 +710,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
} }
// metaDataValue needs to be reset to an empty string // metaDataValue needs to be reset to an empty string
metaDataValue = new String(""); metaDataValue = "";
} }
setTag(-1); setTag(-1);
break; break;
...@@ -736,7 +736,7 @@ public class XmlReaderContentHandler extends DefaultHandler { ...@@ -736,7 +736,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
insertValue(tempStr); insertValue(tempStr);
} }
// columnValue now need to be reset to the empty string // columnValue now need to be reset to the empty string
columnValue = new String(""); columnValue = "";
} catch (SQLException ex) { } catch (SQLException ex) {
throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errinsert").toString(), ex.getMessage())); throw new SAXException(MessageFormat.format(resBundle.handleGetObject("xmlrch.errinsert").toString(), ex.getMessage()));
} }
......
/* /*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -734,7 +734,7 @@ public static final int ASCII_STREAM_PARAM = 2; ...@@ -734,7 +734,7 @@ public static final int ASCII_STREAM_PARAM = 2;
throw new SQLException("Set initParams() before setCommand"); throw new SQLException("Set initParams() before setCommand");
} }
params.clear(); params.clear();
command = new String(cmd); command = cmd;
} }
} }
...@@ -797,7 +797,7 @@ public static final int ASCII_STREAM_PARAM = 2; ...@@ -797,7 +797,7 @@ public static final int ASCII_STREAM_PARAM = 2;
throw new SQLException("Invalid url string detected. " + throw new SQLException("Invalid url string detected. " +
"Cannot be of length less than 1"); "Cannot be of length less than 1");
} else { } else {
URL = new String(url); URL = url;
} }
dataSource = null; dataSource = null;
...@@ -854,7 +854,7 @@ public static final int ASCII_STREAM_PARAM = 2; ...@@ -854,7 +854,7 @@ public static final int ASCII_STREAM_PARAM = 2;
} else if (name.equals("")) { } else if (name.equals("")) {
throw new SQLException("DataSource name cannot be empty string"); throw new SQLException("DataSource name cannot be empty string");
} else { } else {
dataSource = new String(name); dataSource = name;
} }
URL = null; URL = null;
...@@ -889,7 +889,7 @@ public static final int ASCII_STREAM_PARAM = 2; ...@@ -889,7 +889,7 @@ public static final int ASCII_STREAM_PARAM = 2;
{ {
username = null; username = null;
} else { } else {
username = new String(name); username = name;
} }
} }
...@@ -924,7 +924,7 @@ public static final int ASCII_STREAM_PARAM = 2; ...@@ -924,7 +924,7 @@ public static final int ASCII_STREAM_PARAM = 2;
{ {
password = null; password = null;
} else { } else {
password = new String(pass); password = pass;
} }
} }
...@@ -1645,7 +1645,7 @@ public static final int ASCII_STREAM_PARAM = 2; ...@@ -1645,7 +1645,7 @@ public static final int ASCII_STREAM_PARAM = 2;
nullVal = new Object[3]; nullVal = new Object[3];
nullVal[0] = null; nullVal[0] = null;
nullVal[1] = new Integer(sqlType); nullVal[1] = new Integer(sqlType);
nullVal[2] = new String(typeName); nullVal[2] = typeName;
if(params == null){ if(params == null){
throw new SQLException("Set initParams() before setNull"); throw new SQLException("Set initParams() before setNull");
......
/* /*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -306,9 +306,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -306,9 +306,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public void setColumnLabel(int columnIndex, String label) throws SQLException { public void setColumnLabel(int columnIndex, String label) throws SQLException {
checkColRange(columnIndex); checkColRange(columnIndex);
if (label != null) { if (label != null) {
colInfo[columnIndex].columnLabel = new String(label); colInfo[columnIndex].columnLabel = label;
} else { } else {
colInfo[columnIndex].columnLabel = new String(""); colInfo[columnIndex].columnLabel = "";
} }
} }
...@@ -326,9 +326,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -326,9 +326,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public void setColumnName(int columnIndex, String columnName) throws SQLException { public void setColumnName(int columnIndex, String columnName) throws SQLException {
checkColRange(columnIndex); checkColRange(columnIndex);
if (columnName != null) { if (columnName != null) {
colInfo[columnIndex].columnName = new String(columnName); colInfo[columnIndex].columnName = columnName;
} else { } else {
colInfo[columnIndex].columnName = new String(""); colInfo[columnIndex].columnName = "";
} }
} }
...@@ -348,9 +348,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -348,9 +348,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public void setSchemaName(int columnIndex, String schemaName) throws SQLException { public void setSchemaName(int columnIndex, String schemaName) throws SQLException {
checkColRange(columnIndex); checkColRange(columnIndex);
if (schemaName != null ) { if (schemaName != null ) {
colInfo[columnIndex].schemaName = new String(schemaName); colInfo[columnIndex].schemaName = schemaName;
} else { } else {
colInfo[columnIndex].schemaName = new String(""); colInfo[columnIndex].schemaName = "";
} }
} }
...@@ -411,9 +411,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -411,9 +411,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public void setTableName(int columnIndex, String tableName) throws SQLException { public void setTableName(int columnIndex, String tableName) throws SQLException {
checkColRange(columnIndex); checkColRange(columnIndex);
if (tableName != null) { if (tableName != null) {
colInfo[columnIndex].tableName = new String(tableName); colInfo[columnIndex].tableName = tableName;
} else { } else {
colInfo[columnIndex].tableName = new String(""); colInfo[columnIndex].tableName = "";
} }
} }
...@@ -432,9 +432,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -432,9 +432,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public void setCatalogName(int columnIndex, String catalogName) throws SQLException { public void setCatalogName(int columnIndex, String catalogName) throws SQLException {
checkColRange(columnIndex); checkColRange(columnIndex);
if (catalogName != null) if (catalogName != null)
colInfo[columnIndex].catName = new String(catalogName); colInfo[columnIndex].catName = catalogName;
else else
colInfo[columnIndex].catName = new String(""); colInfo[columnIndex].catName = "";
} }
/** /**
...@@ -474,9 +474,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -474,9 +474,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
throws SQLException { throws SQLException {
checkColRange(columnIndex); checkColRange(columnIndex);
if (typeName != null) { if (typeName != null) {
colInfo[columnIndex].colTypeName = new String(typeName); colInfo[columnIndex].colTypeName = typeName;
} else { } else {
colInfo[columnIndex].colTypeName = new String(""); colInfo[columnIndex].colTypeName = "";
} }
} }
...@@ -827,7 +827,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -827,7 +827,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* or the given column number is out of bounds * or the given column number is out of bounds
*/ */
public String getColumnClassName(int columnIndex) throws SQLException { public String getColumnClassName(int columnIndex) throws SQLException {
String className = (new String()).getClass().getName(); String className = String.class.getName();
int sqlType = getColumnType(columnIndex); int sqlType = getColumnType(columnIndex);
...@@ -835,65 +835,62 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable { ...@@ -835,65 +835,62 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
case Types.NUMERIC: case Types.NUMERIC:
case Types.DECIMAL: case Types.DECIMAL:
className = (new java.math.BigDecimal(0)).getClass().getName (); className = java.math.BigDecimal.class.getName();
break; break;
case Types.BIT: case Types.BIT:
className = (new Boolean(false)).getClass().getName (); className = java.lang.Boolean.class.getName();
break; break;
case Types.TINYINT: case Types.TINYINT:
className = (new Byte("0")).getClass().getName (); className = java.lang.Byte.class.getName();
break; break;
case Types.SMALLINT: case Types.SMALLINT:
className = (new Short("0")).getClass().getName (); className = java.lang.Short.class.getName();
break; break;
case Types.INTEGER: case Types.INTEGER:
className = (new Integer(0)).getClass().getName (); className = java.lang.Integer.class.getName();
break; break;
case Types.BIGINT: case Types.BIGINT:
className = (new Long(0)).getClass().getName (); className = java.lang.Long.class.getName();
break; break;
case Types.REAL: case Types.REAL:
className = (new Float(0)).getClass().getName (); className = java.lang.Float.class.getName();
break; break;
case Types.FLOAT: case Types.FLOAT:
case Types.DOUBLE: case Types.DOUBLE:
className = (new Double(0)).getClass().getName(); className = java.lang.Double.class.getName();
break; break;
case Types.BINARY: case Types.BINARY:
case Types.VARBINARY: case Types.VARBINARY:
case Types.LONGVARBINARY: case Types.LONGVARBINARY:
byte[] b = {}; className = "byte[]";
className = (b.getClass()).getName();
break; break;
case Types.DATE: case Types.DATE:
className = (new java.sql.Date(123456)).getClass().getName (); className = java.sql.Date.class.getName();
break; break;
case Types.TIME: case Types.TIME:
className = (new java.sql.Time(123456)).getClass().getName (); className = java.sql.Time.class.getName();
break; break;
case Types.TIMESTAMP: case Types.TIMESTAMP:
className = (new java.sql.Timestamp(123456)).getClass().getName (); className = java.sql.Timestamp.class.getName();
break; break;
case Types.BLOB: case Types.BLOB:
byte[] blob = {}; className = java.sql.Blob.class.getName();
className = (blob.getClass()).getName();
break; break;
case Types.CLOB: case Types.CLOB:
char[] c = {}; className = java.sql.Clob.class.getName();
className = (c.getClass()).getName();
break; break;
} }
......
/* /*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -77,7 +77,7 @@ public class SerialRef implements Ref, Serializable, Cloneable { ...@@ -77,7 +77,7 @@ public class SerialRef implements Ref, Serializable, Cloneable {
throw new SQLException("Cannot instantiate a SerialRef object " + throw new SQLException("Cannot instantiate a SerialRef object " +
"that returns a null base type name"); "that returns a null base type name");
} else { } else {
baseTypeName = new String(ref.getBaseTypeName()); baseTypeName = ref.getBaseTypeName();
} }
} }
......
/* /*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -94,7 +94,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable { ...@@ -94,7 +94,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
try { try {
// get the type name // get the type name
SQLTypeName = new String(in.getSQLTypeName()); SQLTypeName = in.getSQLTypeName();
System.out.println("SQLTypeName: " + SQLTypeName); System.out.println("SQLTypeName: " + SQLTypeName);
// get the attributes of the struct // get the attributes of the struct
...@@ -137,7 +137,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable { ...@@ -137,7 +137,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
try { try {
//set the type name //set the type name
SQLTypeName = new String(in.getSQLTypeName()); SQLTypeName = in.getSQLTypeName();
Vector tmp = new Vector(); Vector tmp = new Vector();
in.writeSQL(new SQLOutputImpl(tmp, map)); in.writeSQL(new SQLOutputImpl(tmp, map));
...@@ -247,7 +247,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable { ...@@ -247,7 +247,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
} }
/** /**
* The identifier that assists in the serialization of this * The identifier that assists in the serialization of this
* <code>SerialStruct</code> object. * <code>SerialStruct</code> object.
*/ */
static final long serialVersionUID = -8322445504027483372L; static final long serialVersionUID = -8322445504027483372L;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册