Stream closed while copying?

Hi, i am trying to open a connection to a url and then trying to save the page to a location. i frequently face a problem in which the copying terminated by itself. This only happens when i try to copy a webpage with big file size. However sometimes it manage to succesfully copy the files. So, can anyone tell me what wrong? Sometimes it can, sometimes cannot. I put my codes in a try catch block but nothing was done in the catch block although i try to print out the error message. My partial codes shown below.
URL _url = new URL("http://www.google.com");
OutputStream out = new FileOutputStream("test.html");
URLConnection conn = _url.openConnection();
conn.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
while ((inputString = reader.read()) != -1) {
    out.write(inputString);
out.flush();
out.close();Thank you.

i managed to track down the error stack. i think the code dies during the execution of method available() of java.net.PlainSocketImpl. I think this is the socket connection problem which throw the exception. the socket should be instantiaed when i call url.openConnection() if i not wrong. and why it dies i really clueless. and somemore it does not die at all times. most time it is ok. any help is very appreciated. below is the error msg. thanks.
java.io.IOException: Stream closed.
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(Throwable.java:87)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.net.PlainSocketImpl.available(Compiled Code)
at java.net.SocketInputStream.available(Compiled Code)
at java.io.BufferedInputStream.read(Compiled Code)
at java.io.FilterInputStream.read(Compiled Code)
at java.io.PushbackInputStream.read(Compiled Code)
at java.io.FilterInputStream.read(Compiled Code)
at java.io.InputStreamReader.fill(Compiled Code)
at java.io.InputStreamReader.read(Compiled Code)
at java.io.BufferedReader.fill(Compiled Code)
at java.io.BufferedReader.readLine(Compiled Code)
at java.io.BufferedReader.readLine(Compiled Code)
at ActionPrintReport.loadPage(Compiled Code)
at ActionPrintReport.<init>(Compiled Code)

Similar Messages

  • Stream Closed BufferedReader in Java

    I do sometimes see an error "Stream Closed" while trying to read a file which has more than 8192 chars (default size of buffer).
    And the buffer sometimes consumes the entire file and some of the times only 8192 characters.
    Will appreciate some one help me on this urgently

    String fileName = "D:/Venkat/test files/file.txt";
    try{
    BufferedReader in = new BufferedReader ( new FileReader
    (fileName));
    String s1 ;
    while ( ( (s1 =in.readLine())!= null) ) {
    count++;      
    if(s1.length() <=75){
    System.out.println("Record length less than 75 "+s1);
    in.close();
    }catch(Exception e){
    //Each Line "s1" contains 80 chars. and when it reaches Line No. 102 it only reads 11 chars from the line. So it totally reads only 8192 chars from the file.When i try to execute the program again it runs with no errors.
    }

  • New-AzureDeployment - Error while copying content to a stream

    Hi All,
    I am trying to deploy a packages using the Azure Powershell Cmdlets.
    Each time I try to deploy a particular package, I get the following error message..
    New-AzureDeployment : Error while copying content to a stream.
    At line:1 char:1
    + New-AzureDeployment -DoNotStart -ServiceName $strStagingCCPDeploymentServiceName ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [New-AzureDeployment], HttpRequestException
        + FullyQualifiedErrorId : System.Net.Http.HttpRequestException,Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.NewAzureDeploymentCommand
    Looking at the inner exception I am getting
    Unable to read data from the transport connection: The connection was closed.
    The package itself is only 80mb and uploads to my blob storage successfully however when it tries to deploy using my config file the error occurs.  The same config file works fine if I use the Azure Website to deploy the package, rather than the cmdlets
    and I can deploy other packages successfully using PowerShell and using Visual Studio.
    Thank you for any help you can provide.

    Hi,
    This seems to be a network issue, but it's quite strange as you can deploy the package from Visual Studio. Could you please try it on another machine (in another network environment if possible)? Also, can you try
    to write a program and call the management API (http://msdn.microsoft.com/en-us/library/windowsazure/ee460813.aspx) to deploy it?
    Best Regards,
    Ming Xu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error encountered while copying audio stream

    In Captivate 4, I attempt to capture screens. I hear the clicking as it captures, I click END when finished. Program attempts to save and then a dialog box displays with "error encountered while copying audio stream". I am not attempting to record any audio.
    I searched the web and found references to this error back two versions and two years - but no solution.
    Does anyone know of a solution? Thanks.

    Hi there,
    I have experienced this on Windows XP. In my case this was due to a dll (Dynamic Link Library) file not being corectly registered in the Windows XP Registry. If you are using XP then take a look at the following blog post.
    Adobe Captivate 4 Installation Issues on Microsoft Windows XP 
    If this doesn't solve the problem or you are using Windows Vista then please report this issue to the Adobe Captivate team using the web address I have included below.
    Adobe Captivate Feature Request/Bug Report Form 
    Best - Mark
    Visit the macrofireball blog

  • Error Encountered while copying Audio Stream on CAPTIVATE 3

    Using Captivate 3 on Windows 2000
    I don't have access to Captivate 4 or a newer version of
    windows while in the office.. I do have admin rights to my machine.
    I'm getting error.. Error encountered while copying audio
    Stream when creating a new project.. I get through my recording..
    and when i "end" the recording it thinks and thinks and then gives
    me this error.
    Please advise on what I can do to fix.

    I just attempted this fix..
    Close Captivate 4 if it is open.
    Download the file kept at
    https://share.acrobat.com/adc/document.do?docid=a14e1bd9-dc10-4456-9cd2-44489809b78e
    Go to your Captivate 4 install folder (ex: C:\Program
    Files\Adobe\Adobe Cativate 4)
    Rename nsaudio.dll as nsaudio.dll.bak or anything which
    doesn't have a dll extension
    Copy the file from step 2 to Captivate 4 install folder
    rename it as nsaudio.dll
    Start Captivate 4
    On Cap 3 to try.. and it didn't work either! Don't know if
    the NSAudio.dll is different for Cap 4 however!

  • Stream closed error while testing a composite in EM

    HI,
    I have deployed a simple composite and wanted to test it in EM. I am getting a stream closed popup, not sure whats wrong?
    I have restarted the server and problem still persists.

    its actually remote server, I am able to deploy a simple HelloWorld composite and even able to see the same in Em.I can even browse through all the composites deployed there by many other people.But problem is when I try to test it its giving the Stream closed error.
    Is it something to do with access permissions, if so i would not have deployed it in first case..
    the pop up error message----
    Stream Closed
    For more information, please see the server's error log for
    an entry beginning with: Server Esception beginning with PPR, #14
    _______________________________

  • WebLogic Server 6.1 SP 3 DocumentBuilder throws IOException: Stream closed

    Hi,
              I have a question about XML processing and error handling, and how the
              WebLogic container affects things.
              Here's what happens to us. We have a servlet parsing XML using DOM.
              The servlet has an InputStream with the content. It gets the default
              DocumentBuilderFactory
              (weblogic.xml.jaxp.RegistryDocumentBuilderFactory) and makes it
              validating. It asks for a DocumentBuilder. It gives the builder our
              own custom error handler to collect up all the SAX parse errors. It
              then tells the builder to parse the input stream. We would expect
              that any problems with the content would be reported as an error to
              our error handler, so that we can then report the errors to the user
              as part of the servlet response.
              However, certain malformed XML content causes the WebLogic parser to
              issue several error messages to System.out and throw an IOException
              with the message "Stream closed". No errors are recorded in our error
              handler. This happens on a variety of inputs, which all revolve
              around the root element start tag being malformed or entirely missing.
              We get this behavior with a totally empty stream, with a stream that
              has the <?xml> and <!DOCTYPE> headers but nothing else, with a stream
              that has the headers and then a malformed start tag like
              "<Submit_Contracts a="1"b="2"/>". I think the programmer would expect
              any of these inputs to cause the parser to simply report a fatal error
              and stop. Throwing an IOException makes it look like it's an error in
              the underlying stream, and clearly it's not. (Most of the test code I
              used actually pulled the XML from a ByteArrayInputStream.)
              Shouldn't WebLogic's parser handle these inputs differently? Throwing
              an IOException can't be correct, can it? Should the application
              instead be responsible for checking that the input has a well-formed
              start tag? In that case the application is doing the parsing that we
              want to rely on the parser to do! Should the application instead
              catch IOExceptions from the parser and report them to the user as
              input errors? In that case the application can potentially swallow
              and ignore harmful system errors.
              The messages on System.out are all along the lines of:
              "<Oct 17, 2002 5:38:03 PM EDT> <Error> <XML> <Failed to open XML
              document. Failed to retrieve PUBLIC id or SYSTEM id from the document.
              Decrease the number of char between the beginning of the document and
              its root element.>
              <Oct 17, 2002 5:38:03 PM EDT> <Error> <XML> <Failed to open XML
              document. Failed to retrieve PUBLIC id. Stream closed>
              <Oct 17, 2002 5:38:03 PM EDT> <Error> <XML> <Failed to parse given XML
              document. Failed to retrieve PUBLIC id. The root element is required
              in a well-formed document.>
              <Oct 17, 2002 5:38:03 PM EDT> <Error> <XML> <Failed to parse given XML
              document. Failed to retrieve SYSTEM id. The root element is required
              in a well-formed document.>
              <Oct 17, 2002 5:38:03 PM EDT> <Error> <XML> <Failed to open XML
              document. Failed to retrieve root tag. Stream closed>
              <Oct 17, 2002 5:38:03 PM EDT> <Error> <XML> <Could not instantiate
              factory class specified in the Server console. Invalid parameters: at
              least one of publicId,systemId, rootTag must be non-null>
              The IOException looks like:
              "java.io.IOException: Stream closed
              at java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:118)
              at java.io.BufferedInputStream.read(BufferedInputStream.java:268)
              at weblogic.apache.xerces.utils.ChunkyByteArray.fill(ChunkyByteArray.java:230)
              at weblogic.apache.xerces.utils.ChunkyByteArray.<init>(ChunkyByteArray.java:106)
              at weblogic.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFactory.java:153)
              at weblogic.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocument(DefaultEntityHandler.java:499)
              at weblogic.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:318)
              at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:974)
              at weblogic.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:183)
              at weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:140)
              at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
              at com.isone.sms.participant.contracts.web.WebLogicParserContainerTest.testWebLogicParserTanksOnEmptyStream(WebLogicParserContainerTest.java:448)
              at java.lang.reflect.Method.invoke(Native Method)
              at junit.framework.TestCase.runTest(TestCase.java:166)
              at junit.framework.TestCase.runBare(TestCase.java:140)
              at junit.framework.TestResult$1.protect(TestResult.java:106)
              at junit.framework.TestResult.runProtected(TestResult.java:124)
              at junit.framework.TestResult.run(TestResult.java:109)
              at junit.framework.TestCase.run(TestCase.java:131)
              at junit.framework.TestSuite.runTest(TestSuite.java:173)
              at junit.framework.TestSuite.run(TestSuite.java:168)
              at com.isone.sms.participant.contracts.web.ContractTestServlet.doPost(ContractTestServlet.java:23)
              at com.isone.sms.participant.contracts.web.ContractTestServlet.doGet(ContractTestServlet.java:16)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)"
              Judging from the IOException, it looks as though WebLogic's wrapper
              parser, RegistryDocumentBuilder, successfully picked a real parser to
              do its work and is passing off the input to be parsed there, even
              though the input's already closed. Perhaps the
              RegistryDocumentBuilder silently screwed up the stream while trying to
              figure out what parser to use, but didn't take that into account
              before attempting to pass it off for parsing. Perhaps the error
              messages on System.out account for when RegistryDocumentBuilder is
              screwing up the stream.
              But if RegistryDocumentBuilder discovers that the stream can't be
              parsed, why can't it simply report a fatal error and stop before
              starting the real parser?
              Mainly I wanted to put this experience up here on a newsgroup because
              I was so surprised that nobody else had reported similar problems. It
              makes me doubt whether our applications are handling the XML parsing
              correctly. But I can't see any other way that makes sense. Please
              let me know what you think!
              Thanks,
              Jim
              

    Hi,
    I got this error when i used JRUN as plugin server through
    Ineternet Information Server. but it was working fine when used it
    as standalone server.
    The reason was beacuase, the inputstream was getting closed . when i removed it, it started working.
    (To be frank , the Inputstream was closed by XML DOM PARSER , which is third party component.)
    and believe that your case is also the same ....
    If you have doubt on that then see that configuration for proxies under your webservers config files
    best of luck
    LOkesh T.C

  • Accordion Widget to be closed WHILE loading

    I know that to have the accordion be closed you set the default tab to -1. I'm doing that. The problem is that while the accordion is loading it is completely open until it is finished loading, then it closes. This behavior looks terrible and my boss doesn't like it. Is there a way to make it closed WHILE it's loading?

    You are not using SpryData on your site, so please remove such code from your markup.
    As I suggest in my first reply to topic. Move the SpryAccordion constructors, that you currently have at the bottom of your page. To directly under the closing div of your accordions. This will remove the flickr.
    I tried doing it this way and there seems to be no change. I've left the source code on the site with these changes still intact for you to investigate if you like. I may still be doing something wrong...
    I'll also copy it here:
    <%@ master language="VB" %>
    <html>
    <head>
    <script type="text/javascript" src="sessionvars.js"></script>
    <script type="text/javascript"><!-- sessvars.myObj = {page:"",acc1:-1,acc2:-1}; //--></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Diamond Phillips</title>
    <link rel="stylesheet" href="DPstylesheet.css" type="text/css" />
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <form id="Form1" runat="server">
         <div>
             <table cellspacing="0" cellpadding="0" align="center">
                 <tr height="70">
                     <td class="title" width="300" valign="bottom" align="left">
                             <img src="images/util/diamondphillips.jpg" /></td>
                    <td class="header" width="646" valign="bottom" align="left"></td>
                </tr>
                <tr height="650">
                     <td class="navigation" width="300" valign="top" align="right">
                        <table width="300" height="798" border="0" align="right">
                          <tr>
                             <td width="294" height="549" colspan="2" align="left" valign="top">
                                <div id="Accordion1" class="Accordion">
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">masterplanning</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="temp2.aspx">content</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">commercial</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="Panama.aspx">Panama</a></div>
                                         <div class="style1"><a href="VanCottBagley.aspx">VanCott Bagley</a></div>
                                    </div>
                                  </div><div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">institutional</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="sutton.aspx">University of Utah Sutton Building</a></div>
                                         <div class="style1"><a href="HCI.aspx" >Huntsman Cancer Institute.</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">residential</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="militaryWay.aspx" >Military Way</a></div>
                                         <div class="style1"><a href="wolcott.aspx" >Wolcott</a></div>
                                         <div class="style1"><a href="BVRanchBarn.aspx" >Blue Valley Ranch - Barn</a></div>
                                         <div class="style1"><a href="BVRanchHouse.aspx" >Blue Valley Ranch - House</a></div>
                                         <div class="style1"><a href="Cabin.aspx" >Cabin</a></div>
                                         <div class="style1"><a href="Cambridge.aspx" >Cambridge</a></div>
                                         <div class="style1"><a href="McClelland.aspx" >McClelland</a></div>
                                         <div class="style1"><a href="Nantucket.aspx" >Nantucket</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">interiors</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="temp2.aspx">commercial content</a></div>
                                         <div class="style1"><a href="temp2.aspx">institutional content</a></div>
                                         <div class="style1"><a href="temp2.aspx">residential content</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">landscape</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="militaryWayLandscape.aspx" >Military Way</a></div>
                                         <div class="style1"><a href="VistaView.aspx">Vista View</a></div>
                                         <div class="style1"><a href="SuttonLnd.aspx">University of Utah Sutton Building</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion2.closePanel(); return false;">furniture</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="temp2.aspx">content</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a href="StudentCoverPage.aspx" onclick="Accordion2.closePanel();">student work</a></div>
                                    <div class="AccordionPanelContent">
                                            <div class="style1"><a href="StudentA.aspx">Grad Student 1</a></div>
                                            <div class="style1"><a href="StudentB.aspx">Grad Student 2</a></div>
                                            <div class="style1"><a href="StudentC.aspx">Grad Student 3</a></div>
                                    </div>
                                  </div>
                                  </div><script type="text/javascript">var Accordion1 = new Spry.Widget.Accordion("Accordion1", {useFixedPanelHeights: false, defaultPanel: -1});</script>
                              </td>
                          </tr>
                          <tr>
                             <td colspan="2" align="left" valign="top">
                             <img src="images/util/dp.jpg" />
                             <div id="Accordion2" class="Accordion" >
                                  <div class="AccordionPanel">
                                    <div class="style1"><a href="firm.aspx" onclick="Accordion1.closePanel(); return false;">firm</a></div>
                                    <div class="AccordionPanelContent"></div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a onclick="Accordion1.closePanel();">references</a></div>
                                    <div class="AccordionPanelContent">
                                         <div class="style1"><a href="temp2.aspx" >content</a></div>
                                    </div>
                                  </div>
                                  <div class="AccordionPanel">
                                    <div class="style1"><a href="Contact.aspx" onclick="Accordion1.closePanel();">contact</a></div>
                                       <div class="AccordionPanelContent">
                                         <div class="style1"><a href="ftp://projects.diamondphillips.com" target="_blank">file transfer</a></div>
                                    </div>
                                  </div>
                             </div>
                             <script type="text/javascript">var Accordion2 = new Spry.Widget.Accordion("Accordion2", {useFixedPanelHeights: false, defaultPanel: -1});</script>
                             </td>
                          </tr>
                        </table>
                        </td>
                    <td class="display" width="646" valign="top" align="left" >
                             <div class="contentPos">
                         <asp:contentplaceholder id="project" runat="server"></asp:contentplaceholder></div>
                                  </td>
                </tr>
                <tr height="45">
                     <td class="footer" colspan="2" valign="bottom" align="center"></td>
                </tr>
            </table>
        </div>
    </form>
    </body>
    </html>
    Thanks

  • I/O error: InputSource: Stream closed

    Hi
    I am new to XML. I am trying to modify XML content using DOM parser. After the modification I want to check if the changes have taken place or not by printing the XML on the console.
    This is what I have done:
    1. Read XML from InputSource
    DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
    Document doc = docBuilder.parse(inputSource);2. Get the nodes to Modify.
    NodeList nodeList = (NodeList)doc.getElementsByTagName("XXX");3. Print the InputSource to check the changes.
    BufferedReader readerTemp = new BufferedReader(new InputStreamReader(inputSource.getByteStream()));
                   String inputLine;
                    while ((inputLine = readerTemp.readLine()) != null) {
                      System.out.println(inputLine);
                    }But however, when I try to view the changes I get an error STREAM CLOSED.
    Please help me, how to open the inputSource again to read the stream from it... what can I do to solve this problem?

    The parser closes the input source, having read it all the way to EOF. So there's nothing left to be read even if the parser didn't close the source.
    So you need a new input source.
    But are the changes taking place on the file, or just in the DOM? In which case re-reading the file won't show any changes - you will need to write the DOM out to the file.
    In which case you can look at it with a text editor. Alternatively you can print the DOM to the console directly.
    So you don't really need the answer to your original question.

  • Stream Closed Error

    Hello!
    I have this 2-class package which gets informations on Microsoft SQL Server 2005 tables and table content. It worked perfectly on J2SE 5. Today I moved to Java J2SE1.6 u1 and recompiled the project. Now, it triggers bizzare Steam Closed exceptions when trying to read a line from the keyboard (if I let exceptions to be thrown). I found several posts regarding this readLine-stream closed issue on the java forums, but none answered this problem satisfactorily. This is my code:
    package databaseinfo;
    import java.io.*;
    import java.sql.*;
    public class DatabaseInfo {
       private static DBConnection dbConn; // connection to DB
       /** connects to the SQL Server 2005, using the given credntials
       public static boolean connect() {
           String username = "test";
           String password = "test";
           String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; // JDBC driver for connecting to MSSQL 2005
           String url = "jdbc:sqlserver://FIREBLADE\\SQLEXPRESS"; // JDBC connection URL to MSSQL 2005
           try {
               dbConn = new DBConnection(username,password,driver,url);
           catch (Exception e) { return false; }
           return true;
       /** disconnects from the SQL Server 2005
       public static void disconnect() {
           try {
               dbConn.logout();
           catch (Exception e) { }
       /** prints the list of tables belonging to the user (dbo) from the current
        *  database
       public static void printTablesList() {
           try {
                dbConn.printQueryResult("EXEC sp_tables @table_owner=dbo");
           catch (Exception e) { return; }
       /** prints extra information and the content of a user-given table
       public static void printTableInfoAndContent() throws IOException {
           try {
               BufferedReader in = new BufferedReader(
                                   new InputStreamReader(System.in));
               String tableName;
               System.out.println("\nGet extra information and the content of which table? ");
               tableName = in.readLine();
               in.close();
               dbConn.printQueryResult("EXEC sp_columns @table_name=" + tableName);
               System.out.println();
               dbConn.printQueryResult("SELECT * FROM " + tableName);       
           catch (IOException e) { }
       public static void main(String args[]) throws IOException {
           connect();
           printTablesList();
           printTableInfoAndContent();
           disconnect();
    package databaseinfo;
    import java.io.*;
    import java.sql.*;
    public class DBConnection {
        // maximum no. of rows on the user console screen
        private final static int maxRowCount = 25;
        private Connection conn; // connection to DB
        /** connects to the MSSQL 2005 database
        public DBConnection (String username, String password, String driver,
                             String url) throws ClassNotFoundException, SQLException {
             login(username,password,driver,url);
        /** login to SQL Server 2005 for a user having a username and a passsword,
         *  using a certain database driver and a given url
        public int login(String username, String password, String driver, String url)
                                                      throws ClassNotFoundException,
                                                             SQLException {
            Class.forName(driver); // sets the JDBC driver
            conn = DriverManager.getConnection(url,username,password); // obtains the JDBC connection
            if (conn != null)
                System.out.println("\nSQL Server Connection established ...\n");
            else {
                System.out.println("\nBad username and/or password.\n");
                return 0;
            return 1;     
        /** closes the JDBC connection
        public void logout() throws SQLException {   
            conn.close();
            System.out.println("\nSQL Server Connection closed.\n");
        /** executes SQL queries and prints their output to the screen
        public void printQueryResult(String sql) {
            try {
                    BufferedReader in = new BufferedReader(
                                        new InputStreamReader(System.in));
                    int rowCount = 0;
                    Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery(sql);
              ResultSetMetaData rsmd = rs.getMetaData();
              int numberOfColumns = rsmd.getColumnCount();   
              int i;
                    for (i = 1; i <= numberOfColumns; i++)
                        System.out.print(rsmd.getColumnName(i)+"\t");
                    System.out.println();
              while (rs.next()) {
                            if ((rowCount != 0) && (rowCount % maxRowCount == 0)) {
                                    System.out.println("\nPress ENTER to continue ... ");
                                    in.read();
                            for (i = 1; i <= numberOfColumns; i++)     
                       System.out.print(rs.getString(i) + "\t\t");
                            rowCount++;
                            System.out.println();
                    in.close();
             catch (Exception e) { }
    }Thanks for reading this post!

    Don't close the input stream, and don't create a new one every time you want to read - create one for the life of the program.

  • Error while copying page. (WWC-44262)

    Error while copying page. (WWC-44262)
    An unexpected error occurred: User-Defined Exception (WWC-44088)
    An unexpected error occurred: User-Defined Exception (WWC-44082)
    An unexpected error occurred: User-Defined Exception (WWC-44082)
    Error while copying page. (WWC-44262)
    Please specify a valid Name and Display Name. (WWC-44102)
    I am not able to make a copy of a page.

    Hi,
    Did you get an answer for this problem?
    Karl

  • Error while copying a process chain.

    Hi All,
    I get an error message while copying the process chain in Production environment.It says "SAP System has status 'not modifiable'".Choose display object or Cancel.I hope this is because of the config. that there is no option to create anything .
    Please confirm.
    Regards,
    Shailja.

    Hi Shailja,
    That means that you can not change that type of object on Quality or Productive server.
    Go to Administrator Workbench, sub menu Transport Connection, there you will find a button called Object Changeability (with a truck). Click on that and change the types of the concerned objects to 'Every changeable' in your case.
    Beware that you must change the status not with a double click but with a right click
    also refer the following thread you can find your solution
    Error message after process chain transport
    Hope this helps
    Regards
    Karthik
    <3rd Reminder for points removed>
    Message was edited by:
    Moderator

  • Do we have option not to refresh the data in AP invoice while copying from GRN and change the date of the invoice in SAP 9 PL 0

    Hi
    I have update tax details in GRPO but while copy to AP invoice system pick posting date/ document date as system date and if i change the date the screen refresh and the tax details i have updated it change. that i do not want.
    Is there any option so that GRPO date will copy in ap invoice so that i need not to refresh the screen
    regards
    Ashish Garg 

    Hi,
    Please provide an example for tax details. Make note on these,
    1. Whenever copy GRPO to AP invoice, posting and document date is system date. This is default design system
    2. If you change these dates in AP invoice, your payment to vendor leads to confusion.
    For example:
    You have received items on 25-03-2014. But vendor raised invoice on 03/04/2014.
    Thanks & Regards,
    Nagarajan

  • My Time Capsule has stopped backing up.  I have an Apple Time Capsule which backs up by wireless. For the last 3 days it has not backed up. I get this message: "The backup was not performed because an error occurred while copying files to the backup disk.

    My Time Capsule has stopped backing up.
    I have an Apple Time Capsule which backs up by wireless. For the last 3 days it has not backed up. I get this message:
    "The backup was not performed because an error occurred while copying files to the backup disk."
    I have gone into Mac Help and followed this down to stage 4:
    under shared it lists my time capsule and my husband's iMac - both use the time machine but we have switched his off temporarily.  Clicking on my Time capsule I get "Connected" and "Sharepoint" - I didn't have to enter connect or password
    I don't understand stage 5: how and where do I select the disk or volume that contains Time Machine backups ?  How do I know which it is? My disk utility lists 160.04 TOSHIBA MK... with sub-heading Macintosh HD.  It also lists (with a "CD" icon) HL-DT-ST DVDRW GS22N
    Under stage 6, how and where do I Locate your backup ? I try dragging my Time capsule from Finder to the Disk Utility side panel but it won't go.  What is my computer's name?
    Please someone help!  I'm completely stumped.
    Thanks,
    Maggie
    Mac Help says:
    If you back up to a Time Capsule or network disk:
    Open the Time Machine pane of System Preferences, and slide the switch to Off.
    Open Time Machine preferences
    Open Disk Utility, which is in the Utilities folder in the Applications folder. 
    Open Disk Utility
    Make sure the Time Capsule or network disk is turned on and available. 
    Open a Finder window, select your Time Capsule or network disk in the Shared section of the sidebar, and click Connect. If necessary, enter your user name and password. 
    On the Time Capsule or network disk, select the disk or volume that contains Time Machine backups. Depending on how your Time Capsule is set up, there may be one or more disks or volumes. 
    Locate your backup, and drag it to the Disk Utility sidebar.You can identify your backup by looking for your computer’s name in the backup’s filename.

    Hello,
    Thanks to the great Pondini...
    http://pondini.org/TM/C3.html

  • Error while copying a movement type

    Hi all,
    I want to create an movement type alternate to 501which will only update the qty not the value.
    1. For  this I have copied movement type 501 through t code OMJJ.
    2. While copying I changed the target movement type as "Y01".
    3. Selected the option of "Copy all dependent entries"
    Now i wanted to modify/delete some dependent entries to get the desired result, but unable to do so.
    such as in section "Update control / WM movement types" , I want to have only 3 lines and want to delete all other lines of special stocks, but unable to do so.
    Similarly with field "Account grouping", system not allowing me to delete any entries.
    Please suggest.
    BKR

    Hi,
    You just need to delete two items from the customizing view, go to next step, that will be okay!
    Regards
    Tao

Maybe you are looking for

  • What is the best Router to use?

    If anyone could help me with choosing a router, that would be great. now, i was at walmart looking for routers cuz i have 2 computers and only have internet for one. now, There r routers called G routers and N routers. the G one is cheaper, but it's

  • "no sim" problem fixed

    I thought I'd share the fix to my problem for others that may be getting the same "no sim" message on their original iPhone. I purchased a second hand iPhone on ebay in the UK and ordered a pay as you go sim from O2 (the 'official' iPhone carrier her

  • Where do the installer files go???

    I have a laptop and a Mac Pro. The laptop travels to the office and other locations where I have great internet access. Downloading and updating my CC apps on the laptop is not a problem. The MacPro lives at home where, for the most part, we have dow

  • Doubt  about COEP table

    Hi ,    I was looking at table COEP by objnr_n1 and kstar fields and found that it is taking almost 5 to 10mins to execute. Is it the general case with this table or is it only with my sap system. thx Raghu

  • Killing the Stored Procedure

    Hi All, I'm having a serious and urgent problem. Please help me in resolving this. I'm trying to excute a Oracle Stored Procedure from the JSP Screen. I.e When i click a Button in the Screen it will run the Stored Procedure (Update a table) at Backgr