United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4217782 : Replacement for java.io.StringBufferInputStream? StringReader is no InputStream!

Details
Type:
Bug
Submit Date:
1999-03-05
Status:
Closed
Updated Date:
1999-05-18
Project Name:
JDK
Resolved Date:
1999-05-18
Component:
core-libs
OS:
generic
Sub-Component:
java.io
CPU:
generic
Priority:
P4
Resolution:
Duplicate
Affected Versions:
1.1.7
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description

Name: dbT83986			Date: 03/05/99


java.io.StringBufferInputStream is deprecated. In the API docs,
the class java.io.StringReader is referenced. But how to convert
this to an InputStream? I need one for PreparedStatement.setAsciiStream:

            java.sql.PreparedStatement ps = _connection.prepareStatement(update);
            String sval = (String)value;
            java.io.StringBufferInputStream sbis = new java.io.StringBufferInputStream(sval);
            ps.setAsciiStream(1,sbis,sval.length()); //1 = first ?
            result = ps.executeUpdate();
            ps.close();

Like most other deprecated things, the java.io.java.io.StringBufferInputStream 
should also have an example how to replace it 1:1
(Review ID: 54538)
======================================================================

                                    

Comments
WORK AROUND



Name: dbT83986			Date: 03/05/99


leave the deprecated class in the code ...
======================================================================
                                     
2004-06-11



Hardware and Software, Engineered to Work Together