Binary value to string

Hi,
I want to convert binary value to string format. How can i do that if possible please give me sample code.?
One more question is i want to do reverse thing also that is convert string value to binary format.?
Waiting for reply

There are methods in Integer, Long etc for transforming to binary.
I think there are probably also methods to go from binary to an int. Check out the JavaDoc

Similar Messages

  • Assigning a hex value to a variable and getting binary value of a variable.

    I try to develop java programs and I need to do a conversion unicode to EBCDIC and vice versa.
    How can I assign hex values to variables to build UTF-EBCDIC and EBCDIC-UTF table and get hex or binary value of data to compare it to value of in the table?
    I did a conversion like this with PL/1 before. I do not know how can I do it with Java. Because I am new to Java.
    Thank you in advance.

    I will run java code in mainframe and java uses
    unicode for data in default and mainframe environment
    is EBCDIC. So I have to translate the data from
    unicode to ebcdic.I said I think String supports EBCDIC encoding...
    String ebcdic = new String(ebcdicBytes, "Cp500");
    http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html

  • Need to convert a binary value into decimal

    Hi i need to convert a binary value which i would be getting as a string object to a decimal value......need code for the same

    Check Integer.parseInt
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html#parseInt(java.lang.String,%20int)

  • Assigning a binary value to an integer

    Hi, I am trying to assign a binary value in my program to an integer. In some assembly languages you would do the following:
    mov a, 00010101b
    for binary and for hex:
    mov a, 0E2h
    In java, you can assign a hex value with:
    int a=0x3F;
    What should I do to assign a binary value? Is it possible?
    Regards... Martin Schmiedel

    The static method parseInt in the java.lang.Integer class can be used to convert a String representing a binary number into its decimal integer value. In addition to the string representing the number, you also pass in an integer representing the radix, which for binary would be 2, hex would be 16, etc. So for example:
    int x = Integer.parseInt("00010110", 2);
    Is that what you're trying to do? Cheers,
    Chris

  • Binary Values unreadable - Database corrupt?

    Hi,
    I'm experiencing a really weird problem here, I have a table with some varchar columns and two binary columns. What I do now, is to select data from it via Python with the following select statement:
    select * from torder where customerid=1624 order by torderid desc
    What happens is, that only for this customerid some binary data is missing, they contain an empty string. If I do the select like this:
    select * from torder where customerid=1624 order by torderid
    It does work, the data is there. With this, it works too:
    select * from torder order by torderid desc
    So it seems, the combination of "customerid=1624" and "desc" somehow corrupts the results.
    What's furthermore interesting is, that when I delete the last inserted row of the result, it works, and if I add a new one, it's broken again.
    I could not check if the error is Python-related or not, as I found no way to retrieve/display the binary data in sqlcli, as it displays only something like 0x8002637A6F70652E6931 , but I doubt that this has something to do with Python.
    Any clues of how to fix this?
    My database version is Kernel    7.6.06   Build 003-121-202-135 | X32/LINUX 7.6.06   Build 003-121-20
    2-135
    Previously, I had 7.6.03 and updated it to the above version, hoping that this would fix the problem, but it did not.
    Best Regards,
    Hermann Himmelbauer

    Ok, first many thanks for your quick reply. I did not answer at first as the problem magically went away. But unfortunately the problem is back today.
    <p/>
    The DDL statements look the following, there are no indexes on the table:
    <p/>
    <pre>
    CREATE TABLE torder (
            torderid INTEGER NOT NULL DEFAULT SERIAL,
            creation_date TIMESTAMP,
            transfer_date TIMESTAMP,
            signed_date TIMESTAMP,
            signed_with VARCHAR(3) CHECK (signed_with in ('TAN', 'BKU', 'MAN') OR signed_with IS NULL),
            revocation_date TIMESTAMP,
            done_date TIMESTAMP,
            formdata LONG BYTE NOT NULL,
            trans_function VARCHAR(30) NOT NULL CHECK (trans_function in ('do_bank_transfer', 'do_bank_collection',
                                    'do_cheque_transfer', 'do_cash', 'do_cashdraw')),
            trans_type VARCHAR(30) NOT NULL CHECK (trans_type in ('national','sepa','international')),
            applet_location VARCHAR(35),
            errors_text VARCHAR(100),
            errors LONG BYTE,
            customerid INTEGER,
            dbuserid INTEGER,
            torder_periodicid INTEGER,
            PRIMARY KEY (torderid),
             FOREIGN KEY(customerid) REFERENCES kunde (kundeid),
             FOREIGN KEY(dbuserid) REFERENCES dbuser (dbuserid),
             FOREIGN KEY(torder_periodicid) REFERENCES torder_periodic (torder_periodicid)
    </pre>
    <p/>
    The insert statements look the following (They are copied out of the SQLAlchemy SQL log), one can see that the binary values are inserted here:
    <p/>
    <pre>
    INFO:sqlalchemy.engine.base.Engine.0x...d110:INSERT INTO torder (creation_date, transfer_date, signed_date, si
    gned_with, revocation_date, done_date, formdata, trans_function, trans_type, applet_location, errors_text, err
    ors, customerid, dbuserid, torder_periodicid) VALUES (now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    INFO:sqlalchemy.engine.base.Engine.0x...d110:['20091027113506345604', None, None, None, None, '\x80\x02}q\x01(
    U\x0bcharges_forq\x02U\x04bothq\x03U\x05dcodeq\x04U\x0588888q\x05U\x0ccurrency_isoq\x06U\x03EURq\x07U\x06valut
    aq\x08K\x00U\x11foreign_acc_name1q\tU\x11Foreign Account 2q\nU\x0cacc_payer_noq\x0bX\t\x00\x00\x00999111110q\x
    0cU\ttextlinesq\r]q\x0e(U\x0c1st transferq\x0fU\tMultilineq\x10U\x0bFor testingq\x11eU\x06amountq\x12cdecimal\
    nDecimal\nq\x13U\x071000.00\x85Rq\x14U\x0cacc_benef_noq\x15X\t\x00\x00\x00888111110q\x16U\x11foreign_acc_name2
    q\x17U\x0bfor Testingq\x18u.', 'do_bank_transfer', 'national', 'url:test_transfer', None, None, None, None, No
    ne]
    </pre>
    <p/>
    All rows are inserted with binary data, so it's never NULL and it's also never set to an empty string ('').
    <p/>
    But when reading back the rows, some binary values are an empty string.
    <p/>
    The following Python code illustrates the problem:
    <pre>
    import sapdb.dbapi
    def true_false_result(result):
        if result:
            return 'Bug begins'
        else:
            return 'Bug ends'
    def check_bincols(bdb, sqlcmd):
        print "----
        print "QUERY: %s" % sqlcmd
        print "----
        bdbc = bdb.cursor()
        bdbe = bdbc.execute(sqlcmd)
        bug_occured = False
        stored_bin_result = False
        while 1:
            row = bdbe.fetchone()
            if row is None:
                break
    Now check if the binary data results to an empty string,
    This should never happen (= the database bug)
            bin_result = (row[7]() == '')
            if bin_result != stored_bin_result:
                bug_occured = True
                print "Toggle to %s at torderid %s" % (
                    true_false_result(bin_result),
                    row[0])
                stored_bin_result = bin_result
        if not bug_occured:
            print "No Bug for this query"
        bdbe.close()
        bdbc.close()
    #bdb.close()
    if __name__ == '__main__':
        bdb = sapdb.dbapi.connect('USER', 'PASS', 'DBNAME', 'LOCALHOST')
    First try the original query, which results in a bug
        sqlcmd = 'select * from torder where customerid=1624 order by torderid desc'
        check_bincols(bdb, sqlcmd)
    This query normally is bugfree
        sqlcmd = 'select * from torder where customerid=1624 order by torderid'
        check_bincols(bdb, sqlcmd)
    This query has a bug, too
        sqlcmd = 'select * from torder order by torderid desc'
        check_bincols(bdb, sqlcmd)
    But this one not
        sqlcmd = 'select * from torder order by torderid'
        check_bincols(bdb, sqlcmd)
    This triggers the bug, too, which is curious as there's practically no ordering
        sqlcmd = 'select * from torder where customerid=1624 order by customerid desc'
        check_bincols(bdb, sqlcmd)
    So, it seems that the bug occurs only when using "DESC" for descending
    ordering.
    </pre>
    <p/>
    The output of this program is:
    <p/>
    <pre>
    QUERY: select * from torder where customerid=1624 order by torderid desc
    Toggle to Bug begins at torderid 1355
    Toggle to Bug ends at torderid 582
    QUERY: select * from torder where customerid=1624 order by torderid
    No Bug for this query
    QUERY: select * from torder order by torderid desc
    No Bug for this query
    QUERY: select * from torder order by torderid
    No Bug for this query
    QUERY: select * from torder where customerid=1624 order by customerid desc
    Toggle to Bug begins at torderid 1355
    Toggle to Bug ends at torderid 582
    </pre>
    <p/>
    So, it can be seen that the problem occurs ONLY when using descending ordering. Moreover it's interesting that the result for "select * from torder order by torderid desc" is sometimes buggy, sometimes not, which seems to be related if someone inserted some more rows or not. What's furthermore interesting is the last query, as there the order is applied to "customerid", which is the very same for every row, so there is no ordering and the bug occurs here, too.
    <p/>
    All this happens on my production instance. I have a testing environment, where I imported the very same data set (same database version etc.) and there is no such problem (for now), so it's quite complicated to nail down the problem further as I cannot easily disrupt the availability of the production instance.
    <p/>
    All I could do for now is not to use the "DESC" command and reorder the data in my application, but that is really suboptimal as I have to keep all results in memory.
    <p/>
    Any help is really appreciated!
    <p/>
    Best Regards,<BR>
    Hermann Himmelbauer
    <p>
    Update: I tried the same query with the following code with C++ / SQLDBC (I modified one of the SQLDBC examples):
    <p>
    <pre>
    First you have to include SQLDBC.h
    #include "SQLDBC.h"
    #include <stdio.h>
    typedef struct ConnectArgsT {
        char * username;
        char * password;
        char * dbname;
        char * host;
    } ConnectArgsT;
    static void parseArgs (ConnectArgsT * connectArgs, int argc, char **argv);
    using namespace SQLDBC;
    Let start your program with a main function
    int main(int argc, char *argv[])
       ConnectArgsT connectArgs;
       parseArgs (&connectArgs, argc, argv);
       char errorText[200];
    Every application has to initialize the SQLDBC library by getting a
    reference to the ClientRuntime and calling the SQLDBC_Environment constructor.
       SQLDBC_IRuntime *runtime;
       runtime = SQLDBC::GetClientRuntime(errorText, sizeof(errorText));
       if (!runtime) {
         fprintf(stderr, "Getting instance of the ClientRuntime failed %s", errorText);
         return (1);
       SQLDBC_Environment env(runtime);
    Create a new connection object and open a session to the database.
       SQLDBC_Connection *conn = env.createConnection();
       SQLDBC_Retcode rc;
       rc = conn->connect(connectArgs.host, connectArgs.dbname,
                          connectArgs.username, connectArgs.password);
       if(SQLDBC_OK != rc) {
         fprintf(stderr, "Connecting to the database failed %s", conn->error().getErrorText());
         return (1);
       printf("Sucessfull connected to %s as user %s\n",
              connectArgs.dbname, connectArgs.username);
    Create a new statment object and execute it.
       SQLDBC_Statement *stmt = conn->createStatement();
       rc = stmt->execute("select * from torder where customerid=1624 order by torderid desc");
       if(SQLDBC_OK != rc) {
         fprintf(stderr, "Execution failed %s", stmt->error().getErrorText());
         return (1);
    Check if the SQL command return a resultset and get a result set object.
       SQLDBC_ResultSet *result;
       result = stmt->getResultSet();
       if(!result) {
         fprintf(stderr, "SQL command doesn't return a result set %s", stmt->error().getErrorText());
         return (1);
    Position the curors within the resultset by doing a fetch next call.
       while (1) {
         rc = result->next();
         if(SQLDBC_OK != rc) {
           break;
           //fprintf(stderr, "Error fetching data %s", stmt->error().getErrorText());
           //return (1);
         char szString[30];
         char szString1[3000];
         SQLDBC_Length ind;
    Get a string value from the column.
         rc = result->getObject(1, SQLDBC_HOSTTYPE_ASCII, szString, &ind, sizeof(szString));
         if(SQLDBC_OK != rc) {
           fprintf(stderr, "Error getObject %s", stmt->error().getErrorText());
           return (1);
         rc = result->getObject(8, SQLDBC_HOSTTYPE_ASCII, szString1, &ind, sizeof(szString1));
         if(SQLDBC_OK != rc) {
           fprintf(stderr, "Error getObject %s", stmt->error().getErrorText());
           return (1);
         printf("%s %s\n", szString, szString1);
    Finish your program with a returncode.
       return 0;
    static void parseArgs (ConnectArgsT * connectArgs, int argc, char **argv)
    setting defaults for demo database
        connectArgs->username = (char*)"USER";
        connectArgs->password = (char*)"PASS";
        connectArgs->dbname = (char*)"MYDB";
        connectArgs->host = (char*)"localhost";
    use values from command line
        if (argc > 4) {
            connectArgs->host = argv [4];
        if (argc > 3) {
            connectArgs->dbname = argv [3];
        if (argc > 2) {
            connectArgs->password = argv [2];
        if (argc > 1) {
            connectArgs->username = argv [1];
    </pre>
    <p/>
    This works!! So it seems, that the problem is related to the Python module, which is interesting, as adding "DESC" should not be any difference to it. I personally suspect that there are some memory leaks in the code, which result in this strange behavior.
    <p/>
    Any suggestions?<p/>
    Best Regards<br>
    Hermann Himmelbauer
    Edited by: Hermann Himmelbauer on Oct 28, 2009 12:51 PM
    Edited by: Hermann Himmelbauer on Oct 28, 2009 12:55 PM

  • Losing the leading zero in binary values

    Hi all,
    I�m currently creating some basic examples of bitwise operations and I�ve just noticed that I�m losing the leadnig zero of a binary value ( e.g.
    decimal 1 (expecting to see bin of 0001) is manifesting as 1
    decimal 16 (expecting to see bin of 00010000) is manifesting as 10000
    below is a full example
    import static java.lang.Integer.*;
    public class BitExample {
    public static void main(String[] args) {   
    System.out.println(
         toBinaryString(0x1) + '\n' +
         toBinaryString(0x16) + '\n' +
         toBinaryString(0x6a) + '\n' +
         toBinaryString(0x80)
    I can see I�m missing something, but not sure what. Can you help?
    Many Thanks
    Giles

    which obviously returns a very different resultNo it does not ... let's translate the example to decimal (with additions instead of bitwise operations, but that doesn't change anything:
    1234 +
    0001
    1235and
    1234 +
    1
    1235both notations are correct, aren't they? Now the second one doesn't look so nice (and usually the 1 should be right-aligned to be easily readable, but it isn't wrong, because of this.
    The same is true for binary operations. The problem is, that while learning bitwise operations it's easier to unserstand if you always write the leading zero (as you do in your example).

  • Find logo from binary or hex string

    HI All ,
    I have file 2 strings one with HEX and one binary this to string is contain the value
    for attachment (logo) ,which FM or method i should use to see the logo, the picture itself  ?
    Regards
    James
    Edited by: James Herb on Feb 28, 2010 5:32 PM

    Hi James,
    This methods and function modules should work for you.
          CALL METHOD cl_binary_relation=>read_links_of_binrel
            EXPORTING
              is_object   = is_object
              ip_relation = 'ATTA'
            IMPORTING
              et_links    = et_links.
        catch
        cx_obl_parameter_error into icx_obl_parameter_error.
          exception_string = icx_obl_parameter_error->get_longtext( ).
        catch cx_obl_internal_error into icx_obl_internal_error .
          exception_string = icx_obl_internal_error->get_longtext( ).
        catch
        cx_obl_model_error into icx_obl_model_error.
          exception_string = icx_obl_model_error->get_longtext( ).
      ENDTRY.
      SORT et_links BY utctime.
      LOOP AT et_links INTO et_links_s.
        v_tbx       = sy-tabix.
        document_id = et_links_s-instid_b.
        CALL FUNCTION 'SO_DOCUMENT_READ_API1'
          EXPORTING
            DOCUMENT_ID                      = document_id
          FILTER                           = 'X '
         IMPORTING
            DOCUMENT_DATA                    = document_data
         TABLES
            OBJECT_HEADER                    = object_header
            OBJECT_CONTENT                   = object_content
          OBJECT_PARA                      =
          OBJECT_PARB                      =
          ATTACHMENT_LIST                  =
          RECEIVER_LIST                    =
          CONTENTS_HEX                     =
         EXCEPTIONS
            DOCUMENT_ID_NOT_EXIST            = 1
            OPERATION_NO_AUTHORIZATION       = 2
            X_ERROR                          = 3
            OTHERS                           = 4.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    ENDLOOP.

  • Get binary value

    Hi all
    Consider that I have a string in hex like this:
    3020058020C00004Now I wanna convert it to binary, then I wanna have each digit single. For example, binary value for above string is:
    11000000100000000001011000000000100000110000000000000000000100And I wanna have
    1
    1
    0
    0
    0
    0
    0
    0
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
    1
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
    0
    0
    0
    0
    1
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
    0How can I achieve this?

                String s_hex = "3020058020C00004";
                String s_bin = Long.toBinaryString(Long.parseLong(s_hex, 16));
                for(int i = 0;i<s_bin.length();i++)
                    System.out.println(s_bin.charAt(i));

  • Binary Stored as String

    Hi,
    I am storing Binary Data into Varchar(Max) field, while migrating to another binary field, since it is stored earlier in the table with the varchar and then insert into Binary will again convert the string into Binary data. which is corrupting   data.
    How to Insert Varchar(max) field to Binary Field in another table
    Thanks, Parth

    Hi Parth,
    Regarding your description, the binary data is stored in a varchar(max)  column, do you mean the values of the varchar(max) column are like ‘0x5445535420535452494E47’? So when you tried to migrate it to a binary field, the string ‘0x5445535420535452494E47’
    was converted into binary other than the value the string stands for?
    If my understanding is correct, you may reference the code as below, just use the built-in
    COVERT with one more optional parameter, you can read more details under 
    Binary Styles in the covert page.
    DECLARE @srcTbl TABLE(str1 VARCHAR(MAX))
    DECLARE @tarTbl TABLE(str1 VARBINARY(MAX))
    INSERT INTO @srcTbl SELECT '0x5445535420535452494E47'
    INSERT INTO @tarTbl SELECT CONVERT(VARBINARY(MAX),str1,1) FROM @srcTbl -- 1 here is necessary
    SELECT str1 FROM @srcTbl
    SELECT str1 FROM @tarTbl
    If you have any question, feel free to let me know.
    Best regards,
    Eric Zhang
    TechNet Community Support

  • How i pass table column  value to string variable or return to java applete

    Hi Master,
    How do I pass a table column value into string variable. See my code below:
    import java.sql.*;
    public class Waheed {
    public Waheed() {
    public static void main (String args [])
    String s = "9 23 45.4 56.7";
    System.out.println ("going for connection");
    // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select accid from accbal");
    System.out.println ("going for connection");
    while (rset.next())
    s= rset.getString("accid"); this line give me error
    System.out.println (rset.getString("accid"));
    System.out.println (s);
    catch(Exception e){
    e.printStackTrace();
    This line give me an error:
    s= rset.getString("accid");
    s is string variable
    Plese give me an idea how I can pass accid in s variable.
    Thanks.
    Aamir

    See the code sample in the following thread (try using upeercase).
    JDBC  connection
    Kuassi

  • How to get the viewrow value by string

    Using Jdev11.1.1.5.0-adfbc-ireport3.0.0
    here i'll describe: what i did.
    am using jsff(dynamic region) while hitting the af:tree nodes it will opens. ok fine
    i had somevo with manually wroten query. and query is fine no problem with that
    here i give sample not a original query
    select * from sometable where acctid = :pacctidi drag and drop the pacctid from corresponding execute params vo as selectoncechoice
    static vo
    Data value - account payable , advance
    Data Name - ap,ad
    in that jsff
    *page representation*
    account type :   account payable (ap) - select one choice type
                            advance           (ad) - select one choice type
    like this some select once choice and some inputs.
    Run report - command button
    .jsff code
    <af:selectOneChoice value="#{bindings.ACCT_TYPE.inputValue}"
                              label="Account Type"
                              shortDesc="#{bindings.ACCT_TYPE.hints.tooltip}"
                              id="soc3" required="true"
                              autoSubmit="true"
                              binding="#{backingBeanScope.SUP1040V.soc3}"
                              valuePassThru="true"
                              valueChangeListener="#{backingBeanScope.SUP1040V.ValueChangeListener1}">
            <f:selectItems value="#{bindings.ACCT_TYPE.items}" id="si3"/>
          </af:selectOneChoice>
    <af:commandToolbarButton text="Export in pdf" id="ctb2">
              <af:fileDownloadActionListener method="#{backingBeanScope.SUP1040V.Report}"
                                             />
            </af:commandToolbarButton>.java
         //while hitting the button following logs are appeared i show it as commented format.
        public void Report(FacesContext context, OutputStream out) throws IOException,Exception
                FacesContext ctx = FacesContext.getCurrentInstance();
                HttpServletRequest request =
                    (HttpServletRequest)ctx.getExternalContext().getRequest();
                HttpServletResponse response = 
                    (HttpServletResponse)ctx.getExternalContext().getResponse();
                BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                System.out.println("print binding" +bindings1 );
    //while using sop i get this in my log : :  print binding  ReportsPageFragments_SUP1040VPageDef_WEB_INF_TaskFlows_SUP1040_V_TF_xml_SUP1040_V_TF
                JUCtrlListBinding listBinding1 = (JUCtrlListBinding)bindings1.get("ACCT_TYPE");
                System.out.println("print list bindings" +listBinding1 );
    //while using sop i get this in my log : :  print list  bindings0
                Object selectedValue1 = listBinding1.getSelectedValue();
                System.out.println("print selected value" + selectedValue1);
    //while using sop i get this in my log : :  print selected  valueViewRow [oracle.jbo.Key[AP ]]   
    request.setAttribute("ACCT_TYPE", //here i want the value  "AP" in  String  );
    if i use like this means
    request.setAttribute("ACCT_TYPE", soc1.getValue()  );  i get the index value.
    i need the dataname "ap" so i go above method which say wrotes ...
                request.getRequestDispatcher(response.encodeURL("/sup1040servlet")).forward(request,response);
                System.out.println("hihihihih");
                response.flushBuffer();
                ctx.responseComplete();
        public void ValueChangeListener1(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String AcctType = valueChangeEvent.getNewValue().toString();
            System.out.println("AcctType" + AcctType);
            FacesContext contxt = FacesContext.getCurrentInstance();
            valueChangeEvent.getComponent().processUpdates(contxt);
           BindingContainer bindings1 =
           BindingContext.getCurrent().getCurrentBindingsEntry();
           // Get the sepecific list binding
           JUCtrlListBinding listBinding1 =
           (JUCtrlListBinding)bindings1.get("ACCT_TYPE");
           // Get the value which is currently selected
           Object selectedValue1 = listBinding1.getSelectedValue();
           System.out.println(selectedValue1);
        }if i get ap means my report runs. or else it will shows empty page.
    how to get the viewrowimpl class value as string.
    Edited by: ADF7 on Mar 24, 2012 7:27 AM

    ADF7,
    I'm not sure I understand what you are up to.
    As far as I understand you want to get the display value instead of the index
    I use this code
        public void StatusChangedListener(ValueChangeEvent valueChangeEvent)
            BindingContext lBindingContext = BindingContext.getCurrent();
            BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry();
            JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("Status");
            int newindex = (Integer) valueChangeEvent.getNewValue();
            Object row = list.getDisplayData(); // Wichtig um die liste zu laden!!!!
            Row lFromList = (Row) list.getValueFromList(newindex);
            Object lAttribute = lFromList.getAttribute("Value");
            String newVal = (String) lAttribute;
        }to get the value from a selectOneChoice component...
    Timo

  • How to get the value of String in integer type

    how to get the value of String in integer

    {color:#0000ff}http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#parseInt(java.lang.String)
    http://java.sun.com/javase/6/docs/api/java/lang/Integer.html#valueOf(java.lang.String){color}

  • Insert Large Binary Values

    Hi all.,
    I want to insert a very large binary value of about 40000 character into database table i have tried by using clob datatype and blob datatype but all my efforts where ended in vain..
    So can any one help me on this......
    Thanks In advance

    You should use the dbms_lob package.
    RTM first, then ask.

  • Determine which value of string is greater

    Hi everybody,
    I have a fairly complex problem which i hope you can help me with..
    The solution is not probably not very hard (i assume), just hard to explain it but I'll give it a try.
    I'm working with arrays. These arrays are "declared" as strings, see below:
                     String[] aa;
                  aa= new String[5];
                  String[] bb;
                  bb=new String [5];
                  String [] cc;
                  cc=new String[5];The programs asks the "tester" to type in three random numbers (see code below)
    System.out.println("First number:");
                   aa=TextIO.getWord();
                        System.out.println("Second number:");
                        bb[i]= TextIO.getWord();
                                  System.out.println("Third number");
                                       cc[i]=TextIO.getWord();
    The program is then supposed to print the greater of the typed values.
    eg. First number is greater._
    How do i make the program to say which one of the three numbers (the numbers can be anything from 0 - 1000000) is greater?
    Since the values are +"Strings,"+ I assume you just can't say
    if aa > bb && aa > cc print("first number is greater")  etc SO, i tried to write it like this:* (but ended up with the error: +"operator && cannot be applied to boolean,int"+
    if (Integer.parseInt(aa) > Integer.parseInt(bb[i]) && Integer.parseInt(aa[i]) > Integer.parseInt(cc[i]))
                        correctanswer = Integer.parseInt(aa[i]);
                   else if (Integer.parseInt(bb[i]) > Integer.parseInt(cc[i]) && Integer.parseInt(aa[i]))
                             correctanswer = Integer.parseInt(bb[i]);
                        else { correctanswer = Integer.parseInt(cc[i]); }
    So the question is: How can i change the code (without changing the strings to int) so it will work?
    I hope i have provided you with enough information, if not, please let me know.
    Thanks

    First off your array declaration is weird for strings. If you don't know the size of the string you are getting from the user then just declare your array like String aa = new String(). Leave it to an untold size!
    Secondly, when you parse you are trying to parse a char. Characters already have an integer value. You need to parse the whole string.
    Thirdly, when actaully getting the input from the user dump the parse into another variable...makes it easier.
    ex: int firstNum = Integer.parseInt(aa) (when you declare it like I did above).
    Fourthly, you need to check each greater than for every instance of the comparison. I.E.
    if(a > b && a > c) {...}
    if(b > a && b > c) {...}
    if(c > a && c > b) {...}
    Note: this goal can be accomplished dozens of different ways its up to you.
    Quick fix: when you do this:
    if (Integer.parseInt(aa) > Integer.parseInt(bb[i]) && Integer.parseInt(aa[i]) > Integer.parseInt(cc[i]))
                        correctanswer = Integer.parseInt(aa[i]);
                   else if (Integer.parseInt(bb[i]) > Integer.parseInt(cc[i]) && Integer.parseInt(aa[i]))
                             correctanswer = Integer.parseInt(bb[i]);
                        else { correctanswer = Integer.parseInt(cc[i]); }
    do this instead:
    if (Integer.parseInt(aa) > Integer.parseInt(bb) && Integer.parseInt(aa) > Integer.parseInt(cc))
                        correctanswer = Integer.parseInt(aa);
                   else if (Integer.parseInt(bb) > Integer.parseInt(cc) && Integer.parseInt(aa))
                             correctanswer = Integer.parseInt(bb);
                        else { correctanswer = Integer.parseInt(cc); }

  • Binary values corrupted in Content Manager

    Hello,
    When I copy and paste (or move) a content that has a property binary, in the second instance (the copy) these properties are corrupted. When I try to access to these properties, I receive the next exception:
    com.bea.content.RepositoryException: No binary value could be found for property.
    I'm working with WLPortal 10.3.
    Is this a bug of Portal?
    Is there any way to do this and the data are not corrupted?
    Thanks.

    When I copy or move there isn't exception, but when I access to the binary property of copy, it log this exception:
    An error occurred while attempting to download the file. Use the browser back button to continue working.
    com.bea.content.RepositoryException: No binary value could be found for property. Repository: catsrv Repository Property ID: 510536002/Docu_relacionada.archivo/510540053 at com.bea.content.manager.internal.InternalNodeOpsBean.getPropertyBytes(InternalNodeOpsBean.java:1853) at com.bea.content.manager.internal.InternalNodeOpsBean.getPropertyBytes(InternalNodeOpsBean.java:2023) at com.bea.content.manager.internal.NodeOpsEJB_ihurl6_ELOImpl.getPropertyBytes(NodeOpsEJB_ihurl6_ELOImpl.java:181) at com.bea.content.manager.internal.NodeOpsImpl.getPropertyBytes(NodeOpsImpl.java:748) at com.bea.content.federated.internal.NodeManagerImpl.getStream(NodeManagerImpl.java:990) at com.bea.portal.tools.content.controls.ContentNodeControlImpl.getStream(ContentNodeControlImpl.java:281) at com.bea.portal.tools.content.controls.ContentNodeControlBean.getStream(ContentNodeControlBean.java:1223) at content.node.nodeSelected.download.DownloadContentController.begin(DownloadContentController.java:184) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:879) at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809) at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478) at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306) at global.internal.AbstractBaseController.internalExecute(AbstractBaseController.java:360) at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336) at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044) at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:91) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853) at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631) at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:503) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:251) at org.apache.beehive.netui.pageflow.internal.DefaultForwardRedirectHandler.forward(DefaultForwardRedirectHandler.java:128) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlowRequestProcessor.java:1801) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processPageFlowRequest(PageFlowRequestProcessor.java:741) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:474) at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853) at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631) at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.jsptools.servlet.PagedResultServiceFilter.doFilter(PagedResultServiceFilter.java:82) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Maybe you are looking for

  • HT3529 SMS sent to multiple contacts were converted into mms.

    SMS sent to multiple contacts were converted into mms, text only 61 characters long including spaces. Carrier O2 have said it is an known issue with apple products. This has cost me £50 to say happy new year to my family and friends. Anyone know of t

  • Loading xml file to javascript

    hi, i want to load xml file from javascript and to get the tree structure dynamically..     xml file is:       <?xml version="1.0"?> <personal>Personal Details         <name>Premshree Pillai</name>         <***>male</***>         <websites>Websites  

  • Would like to use both ports adc dvi for hdmi for maca1047

    I have a Mac A1047 dual 2.0 and would like to use both ports, adc/dvi to hdmi is the an adapter for both? I am in Michigan is there a store here does apple store carry anything like this and do I have to go online?

  • Permissions on JMS queues

    With WLS 7, how is it possible to give a user only receive permissions on a JMS destination while another user is given only send permissions? This could be done with ACLs in earlier versios on WLS. How to do it with roles and policies? I know I can

  • Problem with Bejewled

    I have a problem with the iPod game Bejewled. When I play it, I have to use the play/pause button. And when I press it, my music goes to pause. When I use the next/previous buttons, they also change the song, at the same time as they opperate the gam