Data Input Question

Hi!
I'm trying to input numbers from the console using "System.in". However, the numbers are never read right. I want to read one number per line. Let the code do the explaining as my explanations are usually not clear...
DataInput = new DataInputStream(System.in);
int Number = DataInput.readInt();What did I do wrong? Does "DataInputStream" only read binary data?

The question isn't about Java Native Interface programming so this isn't the right forum. Try the generic Java Programming forum instead.
But to answer it anyway, you are correct that java.io.DataInputStream.readInt treats the input as binary rather than as user-typed digit characters. See the docs for java.io.DataInput.readInt for details.
(Also suggest not naming local variables with an initial capital letter like DataInput or Number. It's confusing for an experienced Java programmer to read and can collide with class names.)
-slj-

Similar Messages

  • Calling Stored Procedure with a DATE input parameter

    Hi. A question about Date input parameters when calling a stored procedure...
    I have a procedure that takes a DATE parameter as input. I would like that DATE value to include a Time element.
    My Application Module method takes an input parameter as java.util.Date (myParamDate) - which will preserve a time element(?).
    However when I create the CallableStatement, I'm trying to set the parameter using setDate like this (for param 5):
                st = getDBTransaction().createCallableStatement("begin cs_my_pck.request_values(?,?,?,?,?,?,?,?); end;", 0);           
                Connection myConn = st.getConnection();
                ArrayDescriptor myArrDesc  =  ArrayDescriptor.createDescriptor("CS_FIELD_TABT", myConn);
                Array sqlParamNameArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramNames.toArray());
                Array sqlParamValueArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramValues.toArray());
                Array sqlFilterNameArray = new oracle.sql.ARRAY(myArrDesc,myConn,filterNames.toArray());
                st.setString(1, repType);
                st.setObject(2, sqlParamNameArray);
                st.setObject(3,sqlParamValueArray);
                st.setObject(4,sqlFilterNameArray);
                java.sql.Date myRepDate = new java.sql.Date(myParamDate.getTime());
                st.setDate(5,myRepDate);
                System.out.println("Report Date = " + myRepDate.toString());
                st.setString(6,repUser);
                st.setString(7,repAttach);
                // set out param
                st.registerOutParameter(8, Types.NUMERIC);
                st.execute();I understand java.sql.Date does NOT include a Time element. But setDate() accepts only a java.sql.Date so my procedure parameter ends up with a zero time element.
    How do I call this procedure retaining the Time element?
    Thanks.

    It includes time element, if you want more precision go with timestamp.
    http://docs.oracle.com/javase/6/docs/api/java/sql/Date.html

  • Why Excel insert cell block, hasn't input for data input?

    Hi
    I found a block for insert new row in excel, but there is no input for data input. how should I insert data by this block to excel file? can you help me?
    that block name: Excel insert cells
    in report generator toolkit
    Best Reagards

    behzad1 a écrit :
    I could work with  Excel insert cell block, but when I want add new data to an old row continuation, last row shift downward! while I want add data to old row. anyone can help me?
    Nobody will be able to identify the problem without seeing your code. Excel Insert Cells.vi is used to add cells to an existing spreadsheet, not to set the cell value. To do this is a more specific way than the Append Report Text.vi you can use Excel Easy Text.vi or Excel Insert Table.vi. With these vis you can specify the range where you want to insert something.
    For your other question (Two different data types) you can use the Excel Set Cell Format.vi to format a range as a date or something else. You will need to use the Excel format specifiers for this.
    Ben64

  • GP doubt in  Data Input form

    Hi Experts,
    I have a doubt in GP Input Data Form callable object.
    When i insert a callable object of type "Data Input Form" and test it.
    It should display Input box and a button only. But i'm getting "Edit/View Attributes Values" and below i'm getting the input box, button. (u can view in following link https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d027c966-b6de-2910-0681-cdb0be7e1b59 )
    My question is, How to avoid "Edit/View Attributes Values"?
    I was following the tutotial
    SAP Composite Application Framework - CAF Tutorial Center [original link is broken]
    Tutotial name: 33 Creating a Callable Object in Group - Data Forms (GP)
    Valuable answers will b rewarded.
    Thanks in Advance,
    Suba

    Hi,
    You are creating Data Input Form callable Object. The template for Data Input Form is provided by SAP. So you can not change the template. It is fixed.
    Which Service Pack are you using? The screen short within the link (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1f589ed1-0c01-0010-9988-e3a67384acd9) are taken from SP7 or before that. But from SP8 onwards you will not get that type of Data Inout Form template. So I think you are using SP8 or nowards. Now staing on your current SP level If you want to hide the "Edit/View Attributes Values" then you need to create your own (custom) Form either using Web Dynpro Application or VC application.
    Please set your requirement which technique and which SP you will use.
    Thanks
    Chandan

  • Error in saving  large value with the data input query

    Hi,
       I  am  trying to save a large value in 0Quantity using the data input query into a realtime infocube
    e-g
    123456789.1234
    Error says too many digits.
    When i try to save 8 digits before the decimal point ,no error, if it is 9digits before decimal it's thro' error.
    Is there any limitation before the decimal.
    i know that 0Quantity can take 17 digits including the sign.
    Any suggestions.?
    regards,
    ram

    try budgetting in thousands in stead of units? (setting on query itself)
    D

  • Tree-control for data input?

    Hi,
    I need to program an input screen for values that have hierarchical dependencies (e.g. sums). I feel, the most adequate user-interface would be a tree control, because of the data dependencies and also because the users asked for a possibility to collapse/expand parts of the data during input.
    I had a look at CL_GUI_COLUMN_TREE, but I'm not sure, if it can be used for data input. Has anyone done something like this before or can anybody direct me to some additional sample coding? (the sample coding in the reuse library didn't do it...)
    Thanks for your help, greetings, Kathrin!

    Hello Kathrin,
    Since you say that the user's input is hierarchical in nature, it is nice to have a tree-control for input. But, the choice of using a custom-control-version of the tree is a cause for some concern. I cannot recollect any of the SAP screens where the input can be given through such a tree framework (please do let me know if you have come across one). The problem with such a tree would be in the areas of even-handling. Filling the tree with appropriate data at the right times would be another challenge.
    However, there's one alternative that I would like to direct your attention to. You must have observed another kind of tree, when you select an application component from the APPLICATION HIERARCHY, which is just like a list. Also, the <i>Transport Organizer (SE09)</i>, <i>Menu Painter (SE41)</i> etc., have this kind of a tree. You can use this if you (or rather your users) are very particular on having a tree display. For more information, you can see the Function Group <b>SEUT</b>, which has the required function modules to accomplish the same. The Function Group is well documented, and you might have to work a little on the function modules themselves.
    Please do let me know if this is a suitable option to meet your requirement. All the best,
    Regards,
    Anand Mandalika.

  • [Solved] CUPS: Unable to write print data: Input/output error

    I'm filling this for the benefit of those poor googlers that can reach here.
    Symptoms: After trying to print a "complex" image the printer made too much breaks, and failed.
    The problem is, it then didn't came up. I mean, I restarted the printer, cupsd, the whole system, and nothing.
    I was unable to print again, it showed "Unable to write print data: Input/output error" and refused to print anything.
    I then saw that in /etc/cups I had printers.conf and printers.conf.O files, which differed (other than in StateTime), that printers.conf.O had
    State Idle
    but printers.conf had:
    State Stopped
    StateMessage Unable to write print data: Input/output error
    Reason paused
    Probably due to the ErrorPolicy being stop-printer.
    So seeing I followed the following steps:
    Stop cups
    Replace printers.conf with printers.conf.O (I could also had manually edited it)
    Start cups
    It then went working flawlessly.
    There was probably an option in the web interface combobox for doing that. The problem is that I didn't realise it was stopped, so didn't know how to make it work. Moreover, some posts in the web recommended reinstalling the printer (which would skip the problem by creating a new printer).

    I think that I had this same problem, and fixed it by reinstalling the printer.  Thank you for your post.

  • How to set todays date in message date input field in uix

    Hello everybody,
    Im using jdeveloper 9015+adf+uix
    I am having an input form and in that i want to set the date input field with the current date(default value).
    Does anybody of you know how I should do this.
    Any help is appreciated,
    Thanks in advance

    Hi,
    Did you figure out on how to default system date in a date input field??
    I have a similar requirement in OA framework. Please let me know if you have any ideas.
    Thanks,
    vinay.

  • How to display current system Date in the Date Input field ?

    Hi,
    I am having a Date Input field( binded to Data type). On load, i would like to display the current system date filled in that input field.
    How do i achieve this ?
    Reg/Venkat

    Hi Venkatesan,
    In your view in your init() method add the following code:
    wdContext.currentContextElement().setOrderDate(new Date(System.currentTimeMillis()));
    this is if your Date-attribute is in the root of the context.
    else you have to set the date in the node where the date-attribute is present with:
    IYOURNODEElement node = wdContext.createYOURNODEElement();
    node.setOrderDate(new Date(System.currentTimeMillis()));
    regards,
    Björn

  • ADF 11g  Date input

    I am using date input component in ADF 11g.
    This component let u select only date. but I want the user be able to select date and time as well.
    which date component should I drop on page ?
    thx
    p

    All you have to do to see it in action is give your ADF BC EO date field the type of Timestemp instead of Date, and possibly add a nice format mask under the UI hints like: yyyy-MM-dd HH:mm:ss
    But, I do not have Entity Object in my application. ADF page was generated as part of "right click BPEL Human Task ---- Auto generate ADF Task Form".
    How do I have time as well in this case ?
    thx
    p

  • Combine year + period as one dimension for data input

    Existing Hyperion Planning has 2 dimension to keep the year and period. Our users would like to have the data entry web form title to show the year+period e.g. Jan 2009 instead of two rows. Is it very difficult to build such a label or a dimension for data input?
    Thanks in advance.

    Jake_Turrell wrote:
    You could do this with custom JavaScript, although I have to say the work would outweigh the benefits.
    Why is it important that they see the year and month with a specific layout on a web input form? Are they printing the form, or using it as a "report"? If so, I would direct them to Financial Reporting, where it is much easier to format labels, etc. Forms shouldn't be used as reports as a general rule.
    - JakeI am referring to the web form. Because there are 12 months in a year and they need to input more than 10 years budget, the label on the web form is not easy to view from our end user point of view. They say that sometimes they will input data in the wrong year. So they prefer to the column label as Jan2009, Feb2009, etc instead.
    Thanks for your help.

  • Open/close line for data input depending on characteristic value

    Hi,
    assume we have an input ready query linked to an analysis item.
    material qty
    1            100
    2              50
    3              70
    How can we achieve that only the line 2  is open for data input by the user
    and the other lines 1/3 are closed.
    Regards
    Paul

    Hi,
    You can use data slice for this. Activate the data slice for sl no 1 and 3  and the appln will not allow you to enter for these records.
    Data slice can be made dynamic to activate/deactive as per your requirement.
    pratyush

  • Developed VI for data input from a Serial RS485 S. Himmelstein 700 Series Signal Conditioner

    Has any one developed a VI for data input from a serial RS485 connection with S. Himmelstein 700 series signal conditioner. Multiple displays and channels. Labview 2009

    Hi 
    I am using the same vi which you have suggested and i have selected proper com port and other settings, but i am not getting any data,but if i send "ADC0" and "*IDN?\n" command alternatively then it is giving the data...but if i do that i will get zero and data alternatively.I want to get data without zero in between.. any solutions on why i have to send *IDN?\n?
    Expand.Evolve.Influence
    Attachments:
    Hammltn.jpg ‏91 KB

  • Use data input form in workflow

    Greetings,
    I need to input some fixed asset information from FI-AA master data in a data input form and route through a workflow process before finally update the asset master data. Does anyone does something similar before? Is it technically possible? Is there any guide available here.
    Thanks
    Steve

    Hi,
    you can put several table controls / alv grids on one dynpro.
    find example in :
    SE38 - environment - reuse library
    Andreas

  • Kernel data input error on start up SSD Drive

    Hi All
    I have a HP Pavilion g6-1c58dx Notebook PC which I purchased while on holiday in the US in Jan 2012. This January I upgraded to an 120GB SSD drive from OCZ and Windows 8. From the first day I was receiving an error on start up, the computer would restart and ask me to investigate a "Kernel Data Input Error". I scanned the drive on several occasions and received the all clear. In March the drive just failed completely losing all my data.
    OCZ have replaced the drive with one of their Agility range, once again I am receiving the same start up error and although I have checked I have the latest version of all my drivers etc it persists. I am of course worried that in a few weeks this drive will also fail.
    It seems unlikely that the same error could occur on two different drives, my query is whether there is a known issue with this notebook and SSD drives and whether there is a solution to the problem.
    Thank You
    Gareth

    I understand that you are receiving a Kernel Data Input Error.
    Is this a blue screen error?  If so, does it give any more details through a more details option?  Some Windows 8 blue screen errors provide less information upfront with a more information option.  
    If it is a blue screen error, uploading the file and sharing the link may be helpful in identifying the core of the issue.
    This site details how to do this using Sky Drive, a Microsoft service.
    Is there a common event (opening a program, performing an action, etc.) that precedes the error?
    If you run the start-up or run-in test (power on and press F2), does the RAM pass the test?  To rule in or out a RAM issue, it may be beneficial to use the run-in test overnight.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

Maybe you are looking for

  • How to create a last page

    Hello all. I am creating an adobe print form where the signature area should be shown at the bottom of the last page only. I am using Adobe LiveCycle Designer 8.1. Here are the steps I did so far: 1. The master page contain the logo at the top of it.

  • Why not using solar cells covering my Macbook

    Hi, My name is Jonathan and I was just wondering. Why is it, that nobody has combined a Macbook/solar powered combination? Probably someone has, but I've never heard of it. Just cover the outside of the screen with enough solarcells, so that it is re

  • How to make each catergory has its own RenderListItem ?

    Hello:    Everyone!    I am using XML Form Builder to creat a Blog,I creat three category which is called most recent blog, topic,bloggers.    I preview the result iview,after I click every category,the RenderListItem is the same.However I need the R

  • Dear Adobe, Stage3D is worthless

    I'm making this post to vent a lot of frustration and disappointment, so I'm going to start by acknowledging the fact that there are a lot of engineers and programmers at adobe who work really hard to make good products, and I appreciate your efforts

  • Disabling the systemTrayIcon property in displayTemplate dont work

    I've tried to update an older application, builded with Director 8.5 and using a couple of MIAWs, to Director MX 2004. All work fine but the MIAWs, using either the new DisplayTemplate panel AND Lingo have a strange behavior: print their icons into t