0N/A/*
2741N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.rowset.internal;
0N/A
0N/Aimport com.sun.rowset.JdbcRowSetResourceBundle;
0N/Aimport java.sql.*;
0N/Aimport javax.sql.*;
0N/Aimport java.io.*;
0N/Aimport java.text.MessageFormat;
0N/Aimport java.util.*;
0N/A
0N/Aimport javax.sql.rowset.*;
0N/Aimport javax.sql.rowset.spi.*;
0N/A
0N/A/**
0N/A * An implementation of the <code>XmlWriter</code> interface, which writes a
0N/A * <code>WebRowSet</code> object to an output stream as an XML document.
0N/A */
0N/A
0N/Apublic class WebRowSetXmlWriter implements XmlWriter, Serializable {
0N/A
0N/A /**
0N/A * The <code>java.io.Writer</code> object to which this <code>WebRowSetXmlWriter</code>
0N/A * object will write when its <code>writeXML</code> method is called. The value
0N/A * for this field is set with the <code>java.io.Writer</code> object given
0N/A * as the second argument to the <code>writeXML</code> method.
0N/A */
0N/A private java.io.Writer writer;
0N/A
0N/A /**
0N/A * The <code>java.util.Stack</code> object that this <code>WebRowSetXmlWriter</code>
0N/A * object will use for storing the tags to be used for writing the calling
0N/A * <code>WebRowSet</code> object as an XML document.
0N/A */
0N/A private java.util.Stack stack;
0N/A
0N/A private JdbcRowSetResourceBundle resBundle;
0N/A
0N/A public WebRowSetXmlWriter() {
0N/A
0N/A try {
0N/A resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
0N/A } catch(IOException ioe) {
0N/A throw new RuntimeException(ioe);
0N/A }
0N/A }
0N/A
0N/A /**
0N/A * Writes the given <code>WebRowSet</code> object as an XML document
0N/A * using the given <code>java.io.Writer</code> object. The XML document
0N/A * will include the <code>WebRowSet</code> object's data, metadata, and
0N/A * properties. If a data value has been updated, that information is also
0N/A * included.
0N/A * <P>
0N/A * This method is called by the <code>XmlWriter</code> object that is
0N/A * referenced in the calling <code>WebRowSet</code> object's
0N/A * <code>xmlWriter</code> field. The <code>XmlWriter.writeXML</code>
0N/A * method passes to this method the arguments that were supplied to it.
0N/A *
0N/A * @param caller the <code>WebRowSet</code> object to be written; must
0N/A * be a rowset for which this <code>WebRowSetXmlWriter</code> object
0N/A * is the writer
0N/A * @param wrt the <code>java.io.Writer</code> object to which
0N/A * <code>caller</code> will be written
0N/A * @exception SQLException if a database access error occurs or
0N/A * this <code>WebRowSetXmlWriter</code> object is not the writer
0N/A * for the given rowset
0N/A * @see XmlWriter#writeXML
0N/A */
0N/A public void writeXML(WebRowSet caller, java.io.Writer wrt)
0N/A throws SQLException {
0N/A
0N/A // create a new stack for tag checking.
0N/A stack = new java.util.Stack();
0N/A writer = wrt;
0N/A writeRowSet(caller);
0N/A }
0N/A
0N/A /**
0N/A * Writes the given <code>WebRowSet</code> object as an XML document
0N/A * using the given <code>java.io.OutputStream</code> object. The XML document
0N/A * will include the <code>WebRowSet</code> object's data, metadata, and
0N/A * properties. If a data value has been updated, that information is also
0N/A * included.
0N/A * <P>
0N/A * Using stream is a faster way than using <code>java.io.Writer<code/>
0N/A *
0N/A * This method is called by the <code>XmlWriter</code> object that is
0N/A * referenced in the calling <code>WebRowSet</code> object's
0N/A * <code>xmlWriter</code> field. The <code>XmlWriter.writeXML</code>
0N/A * method passes to this method the arguments that were supplied to it.
0N/A *
0N/A * @param caller the <code>WebRowSet</code> object to be written; must
0N/A * be a rowset for which this <code>WebRowSetXmlWriter</code> object
0N/A * is the writer
0N/A * @param oStream the <code>java.io.OutputStream</code> object to which
0N/A * <code>caller</code> will be written
0N/A * @throws SQLException if a database access error occurs or
0N/A * this <code>WebRowSetXmlWriter</code> object is not the writer
0N/A * for the given rowset
0N/A * @see XmlWriter#writeXML
0N/A */
0N/A public void writeXML(WebRowSet caller, java.io.OutputStream oStream)
0N/A throws SQLException {
0N/A
0N/A // create a new stack for tag checking.
0N/A stack = new java.util.Stack();
0N/A writer = new OutputStreamWriter(oStream);
0N/A writeRowSet(caller);
0N/A }
0N/A
0N/A /**
0N/A *
0N/A *
0N/A * @exception SQLException if a database access error occurs
0N/A */
0N/A private void writeRowSet(WebRowSet caller) throws SQLException {
0N/A
0N/A try {
0N/A
0N/A startHeader();
0N/A
0N/A writeProperties(caller);
0N/A writeMetaData(caller);
0N/A writeData(caller);
0N/A
0N/A endHeader();
0N/A
0N/A } catch (java.io.IOException ex) {
0N/A throw new SQLException(MessageFormat.format(resBundle.handleGetObject("wrsxmlwriter.ioex").toString(), ex.getMessage()));
0N/A }
0N/A }
0N/A
0N/A private void startHeader() throws java.io.IOException {
0N/A
0N/A setTag("webRowSet");
0N/A writer.write("<?xml version=\"1.0\"?>\n");
0N/A writer.write("<webRowSet xmlns=\"http://java.sun.com/xml/ns/jdbc\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n");
0N/A writer.write("xsi:schemaLocation=\"http://java.sun.com/xml/ns/jdbc http://java.sun.com/xml/ns/jdbc/webrowset.xsd\">\n");
0N/A }
0N/A
0N/A private void endHeader() throws java.io.IOException {
0N/A endTag("webRowSet");
0N/A }
0N/A
0N/A /**
0N/A *
0N/A *
0N/A * @exception SQLException if a database access error occurs
0N/A */
0N/A private void writeProperties(WebRowSet caller) throws java.io.IOException {
0N/A
0N/A beginSection("properties");
0N/A
0N/A try {
0N/A propString("command", processSpecialCharacters(caller.getCommand()));
0N/A propInteger("concurrency", caller.getConcurrency());
0N/A propString("datasource", caller.getDataSourceName());
0N/A propBoolean("escape-processing",
0N/A caller.getEscapeProcessing());
0N/A
0N/A try {
0N/A propInteger("fetch-direction", caller.getFetchDirection());
0N/A } catch(SQLException sqle) {
0N/A // it may be the case that fetch direction has not been set
0N/A // fetchDir == 0
0N/A // in that case it will throw a SQLException.
0N/A // To avoid that catch it here
0N/A }
0N/A
0N/A propInteger("fetch-size", caller.getFetchSize());
0N/A propInteger("isolation-level",
0N/A caller.getTransactionIsolation());
0N/A
0N/A beginSection("key-columns");
0N/A
0N/A int[] kc = caller.getKeyColumns();
0N/A for (int i = 0; kc != null && i < kc.length; i++)
0N/A propInteger("column", kc[i]);
0N/A
0N/A endSection("key-columns");
0N/A
0N/A //Changed to beginSection and endSection for maps for proper indentation
0N/A beginSection("map");
0N/A java.util.Map typeMap = caller.getTypeMap();
0N/A if (typeMap != null) {
0N/A Iterator i = typeMap.keySet().iterator();
0N/A Class c;
0N/A String type;
0N/A while (i.hasNext()) {
0N/A type = (String)i.next();
0N/A c = (Class)typeMap.get(type);
0N/A propString("type", type);
0N/A propString("class", c.getName());
0N/A }
0N/A }
0N/A endSection("map");
0N/A
0N/A propInteger("max-field-size", caller.getMaxFieldSize());
0N/A propInteger("max-rows", caller.getMaxRows());
0N/A propInteger("query-timeout", caller.getQueryTimeout());
0N/A propBoolean("read-only", caller.isReadOnly());
0N/A
0N/A int itype = caller.getType();
0N/A String strType = "";
0N/A
0N/A if(itype == 1003) {
0N/A strType = "ResultSet.TYPE_FORWARD_ONLY";
0N/A } else if(itype == 1004) {
0N/A strType = "ResultSet.TYPE_SCROLL_INSENSITIVE";
0N/A } else if(itype == 1005) {
0N/A strType = "ResultSet.TYPE_SCROLL_SENSITIVE";
0N/A }
0N/A
0N/A propString("rowset-type", strType);
0N/A
0N/A propBoolean("show-deleted", caller.getShowDeleted());
0N/A propString("table-name", caller.getTableName());
0N/A propString("url", caller.getUrl());
0N/A
0N/A beginSection("sync-provider");
0N/A // Remove the string after "@xxxx"
0N/A // before writing it to the xml file.
0N/A String strProviderInstance = (caller.getSyncProvider()).toString();
0N/A String strProvider = strProviderInstance.substring(0, (caller.getSyncProvider()).toString().indexOf("@"));
0N/A
0N/A propString("sync-provider-name", strProvider);
2802N/A propString("sync-provider-vendor", "Oracle Corporation");
0N/A propString("sync-provider-version", "1.0");
0N/A propInteger("sync-provider-grade", caller.getSyncProvider().getProviderGrade());
0N/A propInteger("data-source-lock", caller.getSyncProvider().getDataSourceLock());
0N/A
0N/A endSection("sync-provider");
0N/A
0N/A } catch (SQLException ex) {
0N/A throw new java.io.IOException(MessageFormat.format(resBundle.handleGetObject("wrsxmlwriter.sqlex").toString(), ex.getMessage()));
0N/A }
0N/A
0N/A endSection("properties");
0N/A }
0N/A
0N/A /**
0N/A *
0N/A *
0N/A * @exception SQLException if a database access error occurs
0N/A */
0N/A private void writeMetaData(WebRowSet caller) throws java.io.IOException {
0N/A int columnCount;
0N/A
0N/A beginSection("metadata");
0N/A
0N/A try {
0N/A
0N/A ResultSetMetaData rsmd = caller.getMetaData();
0N/A columnCount = rsmd.getColumnCount();
0N/A propInteger("column-count", columnCount);
0N/A
0N/A for (int colIndex = 1; colIndex <= columnCount; colIndex++) {
0N/A beginSection("column-definition");
0N/A
0N/A propInteger("column-index", colIndex);
0N/A propBoolean("auto-increment", rsmd.isAutoIncrement(colIndex));
0N/A propBoolean("case-sensitive", rsmd.isCaseSensitive(colIndex));
0N/A propBoolean("currency", rsmd.isCurrency(colIndex));
0N/A propInteger("nullable", rsmd.isNullable(colIndex));
0N/A propBoolean("signed", rsmd.isSigned(colIndex));
0N/A propBoolean("searchable", rsmd.isSearchable(colIndex));
0N/A propInteger("column-display-size",rsmd.getColumnDisplaySize(colIndex));
0N/A propString("column-label", rsmd.getColumnLabel(colIndex));
0N/A propString("column-name", rsmd.getColumnName(colIndex));
0N/A propString("schema-name", rsmd.getSchemaName(colIndex));
0N/A propInteger("column-precision", rsmd.getPrecision(colIndex));
0N/A propInteger("column-scale", rsmd.getScale(colIndex));
0N/A propString("table-name", rsmd.getTableName(colIndex));
0N/A propString("catalog-name", rsmd.getCatalogName(colIndex));
0N/A propInteger("column-type", rsmd.getColumnType(colIndex));
0N/A propString("column-type-name", rsmd.getColumnTypeName(colIndex));
0N/A
0N/A endSection("column-definition");
0N/A }
0N/A } catch (SQLException ex) {
0N/A throw new java.io.IOException(MessageFormat.format(resBundle.handleGetObject("wrsxmlwriter.sqlex").toString(), ex.getMessage()));
0N/A }
0N/A
0N/A endSection("metadata");
0N/A }
0N/A
0N/A /**
0N/A *
0N/A *
0N/A * @exception SQLException if a database access error occurs
0N/A */
0N/A private void writeData(WebRowSet caller) throws java.io.IOException {
0N/A ResultSet rs;
0N/A
0N/A try {
0N/A ResultSetMetaData rsmd = caller.getMetaData();
0N/A int columnCount = rsmd.getColumnCount();
0N/A int i;
0N/A
0N/A beginSection("data");
0N/A
0N/A caller.beforeFirst();
0N/A caller.setShowDeleted(true);
0N/A while (caller.next()) {
0N/A if (caller.rowDeleted() && caller.rowInserted()) {
0N/A beginSection("modifyRow");
0N/A } else if (caller.rowDeleted()) {
0N/A beginSection("deleteRow");
0N/A } else if (caller.rowInserted()) {
0N/A beginSection("insertRow");
0N/A } else {
0N/A beginSection("currentRow");
0N/A }
0N/A
0N/A for (i = 1; i <= columnCount; i++) {
0N/A if (caller.columnUpdated(i)) {
0N/A rs = caller.getOriginalRow();
0N/A rs.next();
0N/A beginTag("columnValue");
0N/A writeValue(i, (RowSet)rs);
0N/A endTag("columnValue");
0N/A beginTag("updateRow");
0N/A writeValue(i, caller);
0N/A endTag("updateRow");
0N/A } else {
0N/A beginTag("columnValue");
0N/A writeValue(i, caller);
0N/A endTag("columnValue");
0N/A }
0N/A }
0N/A
0N/A endSection(); // this is unchecked
0N/A }
0N/A endSection("data");
0N/A } catch (SQLException ex) {
0N/A throw new java.io.IOException(MessageFormat.format(resBundle.handleGetObject("wrsxmlwriter.sqlex").toString(), ex.getMessage()));
0N/A }
0N/A }
0N/A
0N/A private void writeValue(int idx, RowSet caller) throws java.io.IOException {
0N/A try {
0N/A int type = caller.getMetaData().getColumnType(idx);
0N/A
0N/A switch (type) {
0N/A case java.sql.Types.BIT:
0N/A case java.sql.Types.BOOLEAN:
0N/A boolean b = caller.getBoolean(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeBoolean(b);
0N/A break;
0N/A case java.sql.Types.TINYINT:
0N/A case java.sql.Types.SMALLINT:
0N/A short s = caller.getShort(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeShort(s);
0N/A break;
0N/A case java.sql.Types.INTEGER:
0N/A int i = caller.getInt(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
2828N/A writeInteger(i);
0N/A break;
0N/A case java.sql.Types.BIGINT:
0N/A long l = caller.getLong(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeLong(l);
0N/A break;
0N/A case java.sql.Types.REAL:
0N/A case java.sql.Types.FLOAT:
0N/A float f = caller.getFloat(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeFloat(f);
0N/A break;
0N/A case java.sql.Types.DOUBLE:
0N/A double d = caller.getDouble(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeDouble(d);
0N/A break;
0N/A case java.sql.Types.NUMERIC:
0N/A case java.sql.Types.DECIMAL:
0N/A writeBigDecimal(caller.getBigDecimal(idx));
0N/A break;
0N/A case java.sql.Types.BINARY:
0N/A case java.sql.Types.VARBINARY:
0N/A case java.sql.Types.LONGVARBINARY:
0N/A break;
0N/A case java.sql.Types.DATE:
0N/A java.sql.Date date = caller.getDate(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeLong(date.getTime());
0N/A break;
0N/A case java.sql.Types.TIME:
0N/A java.sql.Time time = caller.getTime(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeLong(time.getTime());
0N/A break;
0N/A case java.sql.Types.TIMESTAMP:
0N/A java.sql.Timestamp ts = caller.getTimestamp(idx);
0N/A if (caller.wasNull())
0N/A writeNull();
0N/A else
0N/A writeLong(ts.getTime());
0N/A break;
0N/A case java.sql.Types.CHAR:
0N/A case java.sql.Types.VARCHAR:
0N/A case java.sql.Types.LONGVARCHAR:
0N/A writeStringData(caller.getString(idx));
0N/A break;
0N/A default:
0N/A System.out.println(resBundle.handleGetObject("wsrxmlwriter.notproper").toString());
0N/A //Need to take care of BLOB, CLOB, Array, Ref here
0N/A }
0N/A } catch (SQLException ex) {
0N/A throw new java.io.IOException(resBundle.handleGetObject("wrsxmlwriter.failedwrite").toString()+ ex.getMessage());
0N/A }
0N/A }
0N/A
0N/A /*
0N/A * This begins a new tag with a indent
0N/A *
0N/A */
0N/A private void beginSection(String tag) throws java.io.IOException {
0N/A // store the current tag
0N/A setTag(tag);
0N/A
0N/A writeIndent(stack.size());
0N/A
0N/A // write it out
0N/A writer.write("<" + tag + ">\n");
0N/A }
0N/A
0N/A /*
0N/A * This closes a tag started by beginTag with a indent
0N/A *
0N/A */
0N/A private void endSection(String tag) throws java.io.IOException {
0N/A writeIndent(stack.size());
0N/A
0N/A String beginTag = getTag();
0N/A
0N/A if(beginTag.indexOf("webRowSet") != -1) {
0N/A beginTag ="webRowSet";
0N/A }
0N/A
0N/A if (tag.equals(beginTag) ) {
0N/A // get the current tag and write it out
0N/A writer.write("</" + beginTag + ">\n");
0N/A } else {
0N/A ;
0N/A }
0N/A writer.flush();
0N/A }
0N/A
0N/A private void endSection() throws java.io.IOException {
0N/A writeIndent(stack.size());
0N/A
0N/A // get the current tag and write it out
0N/A String beginTag = getTag();
0N/A writer.write("</" + beginTag + ">\n");
0N/A
0N/A writer.flush();
0N/A }
0N/A
0N/A private void beginTag(String tag) throws java.io.IOException {
0N/A // store the current tag
0N/A setTag(tag);
0N/A
0N/A writeIndent(stack.size());
0N/A
0N/A // write tag out
0N/A writer.write("<" + tag + ">");
0N/A }
0N/A
0N/A private void endTag(String tag) throws java.io.IOException {
0N/A String beginTag = getTag();
0N/A if (tag.equals(beginTag)) {
0N/A // get the current tag and write it out
0N/A writer.write("</" + beginTag + ">\n");
0N/A } else {
0N/A ;
0N/A }
0N/A writer.flush();
0N/A }
0N/A
0N/A private void emptyTag(String tag) throws java.io.IOException {
0N/A // write an emptyTag
0N/A writer.write("<" + tag + "/>");
0N/A }
0N/A
0N/A private void setTag(String tag) {
0N/A // add the tag to stack
0N/A stack.push(tag);
0N/A }
0N/A
0N/A private String getTag() {
0N/A return (String)stack.pop();
0N/A }
0N/A
0N/A private void writeNull() throws java.io.IOException {
0N/A emptyTag("null");
0N/A }
0N/A
0N/A private void writeStringData(String s) throws java.io.IOException {
0N/A if (s == null) {
0N/A writeNull();
0N/A } else if (s.equals("")) {
0N/A writeEmptyString();
0N/A } else {
0N/A
0N/A s = processSpecialCharacters(s);
0N/A
0N/A writer.write(s);
0N/A }
0N/A }
0N/A
0N/A private void writeString(String s) throws java.io.IOException {
0N/A if (s != null) {
0N/A writer.write(s);
0N/A } else {
0N/A writeNull();
0N/A }
0N/A }
0N/A
0N/A
0N/A private void writeShort(short s) throws java.io.IOException {
0N/A writer.write(Short.toString(s));
0N/A }
0N/A
0N/A private void writeLong(long l) throws java.io.IOException {
0N/A writer.write(Long.toString(l));
0N/A }
0N/A
0N/A private void writeInteger(int i) throws java.io.IOException {
0N/A writer.write(Integer.toString(i));
0N/A }
0N/A
0N/A private void writeBoolean(boolean b) throws java.io.IOException {
2828N/A writer.write(Boolean.valueOf(b).toString());
0N/A }
0N/A
0N/A private void writeFloat(float f) throws java.io.IOException {
0N/A writer.write(Float.toString(f));
0N/A }
0N/A
0N/A private void writeDouble(double d) throws java.io.IOException {
0N/A writer.write(Double.toString(d));
0N/A }
0N/A
0N/A private void writeBigDecimal(java.math.BigDecimal bd) throws java.io.IOException {
0N/A if (bd != null)
0N/A writer.write(bd.toString());
0N/A else
0N/A emptyTag("null");
0N/A }
0N/A
0N/A private void writeIndent(int tabs) throws java.io.IOException {
0N/A // indent...
0N/A for (int i = 1; i < tabs; i++) {
0N/A writer.write(" ");
0N/A }
0N/A }
0N/A
0N/A private void propString(String tag, String s) throws java.io.IOException {
0N/A beginTag(tag);
0N/A writeString(s);
0N/A endTag(tag);
0N/A }
0N/A
0N/A private void propInteger(String tag, int i) throws java.io.IOException {
0N/A beginTag(tag);
0N/A writeInteger(i);
0N/A endTag(tag);
0N/A }
0N/A
0N/A private void propBoolean(String tag, boolean b) throws java.io.IOException {
0N/A beginTag(tag);
0N/A writeBoolean(b);
0N/A endTag(tag);
0N/A }
0N/A
0N/A private void writeEmptyString() throws java.io.IOException {
0N/A emptyTag("emptyString");
0N/A }
0N/A /**
0N/A * Purely for code coverage purposes..
0N/A */
0N/A public boolean writeData(RowSetInternal caller) {
0N/A return false;
0N/A }
0N/A
0N/A
0N/A /**
0N/A * This function has been added for the processing of special characters
0N/A * lik <,>,'," and & in the data to be serialized. These have to be taken
0N/A * of specifically or else there will be parsing error while trying to read
0N/A * the contents of the XML file.
0N/A **/
0N/A
0N/A private String processSpecialCharacters(String s) {
0N/A
0N/A if(s == null) {
0N/A return null;
0N/A }
0N/A char []charStr = s.toCharArray();
2823N/A String specialStr = "";
0N/A
0N/A for(int i = 0; i < charStr.length; i++) {
0N/A if(charStr[i] == '&') {
0N/A specialStr = specialStr.concat("&amp;");
0N/A } else if(charStr[i] == '<') {
0N/A specialStr = specialStr.concat("&lt;");
0N/A } else if(charStr[i] == '>') {
0N/A specialStr = specialStr.concat("&gt;");
0N/A } else if(charStr[i] == '\'') {
0N/A specialStr = specialStr.concat("&apos;");
0N/A } else if(charStr[i] == '\"') {
0N/A specialStr = specialStr.concat("&quot;");
0N/A } else {
0N/A specialStr = specialStr.concat(String.valueOf(charStr[i]));
0N/A }
0N/A }
0N/A
0N/A s = specialStr;
0N/A return s;
0N/A }
0N/A
2741N/A
2741N/A /**
2741N/A * This method re populates the resBundle
2741N/A * during the deserialization process
2741N/A *
2741N/A */
2741N/A private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
2741N/A // Default state initialization happens here
2741N/A ois.defaultReadObject();
2741N/A // Initialization of transient Res Bundle happens here .
2741N/A try {
2741N/A resBundle = JdbcRowSetResourceBundle.getJdbcRowSetResourceBundle();
2741N/A } catch(IOException ioe) {
2741N/A throw new RuntimeException(ioe);
2741N/A }
2741N/A
2741N/A }
2741N/A
2741N/A static final long serialVersionUID = 7163134986189677641L;
0N/A}