How to access the field of String type?

My Database is Oracle 8.0.5,
client is JDK1.3 and classes12.zip.
the database table likes this:
CREATE TABLE T_KNIGHT
ID INTEGER,
NAME CHAR(20) NULL,
BIRTH DATE,
PRIMARY KEY (ID)
my java program likes this:
String SqlStr = "SELECT ID, NAME, BIRTH FROM T_KNIGHT";
Class.forName ("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@server:1521:orcl", "", "");
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery (SqlStr);
rs.moveToInsertRow();
rs.updateInt(1, 4);
rs.updateString(2, "MyName");
rs.updateDate(3, new java.sql.Date (System.currentTimeMillis ()));
rs.insertRow();
rs.moveToCurrentRow();
while execute the line "rs.insertRow();", an exception is threw out :
java.sql.SQLException: unsupport character set: oracle-character-set-832
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:775)
at oracle.sql.CharacterSetUnknown.failCharsetUnknown(CharacterSetFactoryThin.java:118)
at oracle.sql.CharacterSetUnknown.convert(CharacterSetFactoryThin.java:82)
at oracle.sql.CHAR.<init>(CHAR.java:109)
at oracle.sql.CHAR.<init>(CHAR.java:133)
at oracle.sql.SQLUtil.makeDatum(SQLUtil.java:563)
at oracle.sql.SQLUtil.makeOracleDatum(SQLUtil.java:937)
at oracle.jdbc.driver.UpdatableResultSet.updateObject(UpdatableResultSet.java:1534)
at oracle.jdbc.driver.UpdatableResultSet.updateString(UpdatableResultSet.java:1345)
at TestOld.insert(TestOld.java:125)
at TestOld.main(TestOld.java:17)
How can I do to resolve that question? Help me, please!!

What do you mean "can't access", check the API Javadocs.
The Field object is part of the Class object, so you have to supply the instance you want to extract the value from e.g.
Field f = FieldClass.class.getDeclaredField("z");
int value = f.getInt(a);(This is pretty nasty, 99 times out of 100 you'd be better to use a Map object).

Similar Messages

  • How to access a field of a structure with a field symbol?

    Dear all,
    Currently I'm trying to access the fields of a structure (called "ls_tbl") dynamicly. The code looks as follows (of course the field symbols are defined correctly ;-):
        ASSIGN lv_f1 TO <lv_f1>.
        ASSIGN lv_f2 TO <lv_f2>.
        lv_pp = ls_tbl-(<lv_f1>).
        lv_pt = ls_tbl-(<lv_f2>).
    Unfortunatly I get the following error message:
    <<The data object "LS_TBL" does not have a component called "".>>          
    I really do not understand why ABAP is trying to interpret the field symbol name as a string. Does anybody have a clue how to access the field of ls_tbl with the help of a field symbol?
    Many thanks!!!

    Hi ,
    Please check the below sample code .
    data : begin of st_table,
                myfiledname type c value '1',
                myfiledname1 type c value '2',
           end of st_table .
    data : lv_filedname(11) type c value 'MYFILEDNAME'
    filed-symbols : <fs> type any,
                    <fs_table> type any.
    assign st_table to <fs_table>.
    Assign lv_filedname to <fs> .
    assign component <fs> of structure <fs_table> to lv_pp.
    Regards,
    Ratheesh BS

  • How to access the Requirements property (& subproperties) of steps and sequences with the TestStand API

    The concept of associating teststand objects to unit requirements for traceability purposes was added to TS 3.5, and I need to find out how to access the array of strings used to store unit requirements in step objects, sequence objects and sequencefile objects. The teststand help file points out that the requirements list of a sequencefile object is accessible using the PropertyObjectFile interface, and also points out that Requirements is a property of the sequence and step classes. Furthermore it implicitly states that the requirements property has a Links subproperty which is an array of strings, but that is pretty much the extent of the documentation on this new feature so far. There seems to be no expression function available to get to those requirements either.
    I know that this feature was added to allow TestStand to interface with RG, and I am planning on using RG, but I would also like to do things with the requirements information within TestStand.
    Anyone? 

    Are you talking about the Requirements Gateway?  It is a separate product from NI that will do what you are looking for.  I haven't used it so I am not sure of the API chain to make it work.  Take a look and see if that is what you were thinking of.
    Hope that this helps,
    Bob Young
    Sorry, I just re-read your original post and see that you are looking to also use the Requirements Gateway, so you obviously know about it.  I don't know what the API changes were that made it work so I am not going to be much help.
    Sorry about posting before getting the correct information from the original.
    Bob Young
    Message Edited by Bob Y. on 08-24-2006 04:54 PM
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • How to access the table type field in the structure

    Hi All,
    I have a BADI CRM_MKT_ADR_SEARCH and a method CHANGE_SEARCH_RESULTS in this method I have a parameter CT_BP_CP_CHANNEL .This parameter has type CRMT_BP_CP_CHANNEL_TAB(this is table type) this has the line type CRMT_BP_CP_CHANNEL(this is structure) in this line type we have one field addrnumber.How to access this field in my method?Please help me in this regard.

    data lw_tab type CRMT_BP_CP_CHANNEL.
    loop at CRMT_BP_CP_CHANNEL_TAB into lw_tab.
       lv_field = lw_tab-addrnumber.
       <further processing>
    endloop.

  • In VB Programming code -- How to access the formula for suppressing a field

    In VB Programming code -- How to access the formula for suppressing a field
    I am using Crystal Reports 2008 v1
    Using VB code, I am attempting to modify a Crystal Report before exporting it into a PDF format and then displaying it on the Web.
    My problem is that I am unable to access the formula used to dynamically suppress a field.
    The following code is working:
    mySections = rd.ReportDefinition.Sections
    For Each mySection As CrystalDecisions.CrystalReports.Engine.Section In mySections
       ' myFieldToChange is a String set to the text of the field I need to adjust the Suppression
       iloop = 0
       For Each RecObj As CrystalDecisions.CrystalReports.Engine.ReportObject In mySection.ReportObjects
               If mySection.ReportObjects.Item(iloop).Name.ToLower = myFieldToChange Then
                   myTextObject = CType(mySection.ReportObjects.Item(iloop), CrystalDecisions.CrystalReports.Engine.TextObject)
                   myTextObject.Text = "new field text goes here"
                   mySection.SectionFormat.EnableSuppress = True
                   '  Here is where I want to change the formula for the Suppression
                End if
                iloop = iloop + 1
        Next
    Next
    I can not find any reference to the actual suppression formula in the SDK help file.
    Note, the EnableSuppress can be set to True for False, but if there is a formula for dynamic suppression, the True or False value is overwritten.  The results of the formula determine the suppression.
    Is there a way to reference this formula.  I know that I can put on in using the Crystal Report Designer software, I need to modify this formula using VB code and the SDK.

    Hello, Mark;
    If you are using the ReportDocument object you do not have access to the Conditional Suppression formula. You can get around it by using a formula field in the report for the supression and then using the FormulaField code to change it at runtime.
    If you want to change the supression condition directly at runtime you need to use RAS and the ReportClientDocument.
    Elaine

  • How to access the Custom Data type variable given in Expression edit control To and From LabVIEW

    Hello, I would like to know how to access the custom data type variable given in the Espression Edit Control from LabVIEW and vice-versa
    Say, the FileGlobals.Reference_Handle (Custom Data Type Variable) contains the
    VISA I/O session (Which in turn contains VISA_DeviceName: String, Session: Number),
    Channel1: Number and
    Channel2: Number
    I am expecting the user to give FileGlobals.Reference_Handle as the input at the ExpressionEdit Control in the edit screen of the VI Call.
    I would like to know how to get the values of this custom data type to LabVIEW?
    Say, if I have the Cluster in LabVIEW like VISA I/O session (Deive Name and Session Number), Channel1 and Channel2
    how do i need to set this cluster to the Custom Data type variable in TestStand?
    Thanks and Regards
    Prakash 

    Hi,
    TestStand to LabVIEW: i didnt understand what you r trying to achieve. But if you are using references, Use Property nodes and Invoke nodes to achieve what you want in LabVIEW.
     LabVIEW to TestStand: check the image below: You need to click the button next to 'container'. I have used a cluster output in the VI.
    Hope this helps
    .......^___________________^
    ....../ '---_BOT ____________ ]
    ...../_==O;;;;;;;;_______.:/
    Attachments:
    1.JPG ‏187 KB

  • How to get the field's type in the database with jdbc?

    How to get the one filed's type(varchar,int,long...etc) with jdbc??
    Can u help me??
    It's best that giving a sample code..

    Thx for your reply,BheegaChicken! But i use it with
    oracle9i jdbc..It doesn't return to my the fields
    type correctly..
    This is problem is caused by oracle jdbc??
    Can u tell me??It depends on the driver classes you are using... some of them don't have an implementation for those methods and you won''t get anything useful. Check the driver documentation.
    ***Annie***

  • 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}

  • How to access dynamic fields in a field symbol

    hi
    how do i access the dynamic fields created in side a field-symbol....
    wht i mean is i have a table, whose workarea i assign to field symbol. but this table is runtime, altough i have debugged and found the values in this table, I want to accees the field symbol in a generic way.
    say the table has 3 fields now fld1 fld2 and fld3 so i want to access the field symbol <fs> as <fs>-(name) where name can be anything fld1 or fld2 whichever i assign....
    thanks. Let me know if you have any further questions.

    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to a field symbol before you can address it in a program.
    Field symbols are similar to de-referenced pointers in the C programming language (that is, pointers to which the content operator * is applied). In ABAP, data references represent a real equivalent to pointers in the sense of variables that contain a memory address and can be used without the contents operator.
    All operations programmed with field symbols are applied to the field assigned to it. A MOVE statement between two field symbols, for example, assigns the contents of the field assigned to another source field symbol to the field assigned to the target field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before the MOVEstatement.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks during the field assignment whether the assigned field matches the type of field symbol.
    Field symbols provide greater flexibility when you address data objects:
    ·        You can assign one field symbol to another, which allows you to address subfields.
    ·        Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    ·        You can also force a field symbol to take different technical properties than those of the field assigned to it (casting).
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. The MOVE statement (with your own auxiliary variables, if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    To declare a field symbol, use the statement
    FIELD-SYMBOLS  .
    For field symbols, the angle brackets are part of the syntax. They identify field symbols in the program code.
    If you do not specify any additions, the field symbol.
    in a static ASSIGN and:
    ASSIGN (dobj) TO  from the second loop pass onwards.

  • How to determine the field size

    I am going to make a multiplatform application that hopefully
    will run on linux and windows 2000.If the os is 2000, then I will use
    vb.net/aspx else I'll use java servlets. I make the connection
    to the web server ( through HTTP) not directly to database server.
    So, the resultset will be stored in the String object. The columns
    will be separated by delimeter. Our problem is how to determine
    the size and type of the fields of mssql,oracle and postgres database
    so that we can include it in the String object.
    Ex.
    String sResultSet=new String();
    ResultSet rs=statement.executeQuery(sSQL);
    while(rs.next()){
    sResultset=sResultSet + rs.getString(field1) + "||" + rs.getString(field2) + "||";
    vertical bars acts as delimeter
    supposedly this is the code:
    sResultset=sResultSet + rs.getString(field1) +"_" + rs.getFieldType() + "_"+
    rs.getFieldSize() + "||" + rs.getString(field2) +"_" + rs.getFieldType() + "_"+
    rs.getFieldSize() + "||";
    supposedly this is the code if rs.getFieldType() and rs.getFieldSize() methods are existing
    Anyone can give me an idea how to get the field type and field size of the database?
    thanks in advance

    Yes, but I dont know how to do it.
    Can you give me an example of using it.
    Thanks in advance

  • How to change the field length in standard sap program.

    Hi All,
    How to change the field length in standard sap program.
    Urgent
    Example:
    Text1 type c length 75,
    To change :
    Text1 type c length 150,
    Point will be rewarded..
    Thank you,
    Vikram.C

    If the only solution is to change the sap standard program, simply change the program, it will prompt for an access key. This key can be retrieved in the SAP support portal (service.sap.com) at keys and requests, sccr keys, register object.
    Sometimes these actions are outsourced to a competence center, so maybe youre not entitled to do this, in any case ask a resident senior developer for support.
    regards, Rob

  • How to access hidden fields in a table

    hi
          what is the use of hidden fields in a table, ie. some fields doesn't visible in the field list of a table.  but the fileds will be visible if u display its contents.
        for example in table t518A the text field is not visible in the field list.  But it will be visible if display its contents.  can any one of u please help me out how to access those fields. 
    regards
    sri

    Hi Srivallika,
    The table T518A has a text table called T518B. You can have a look at this table by:-
    1. GOTO SE11 and display table T518A.
    2. GOTO menu GOTO -> TEXT table. It gives the text table for the given table. Here its is T518B.
    A Text table is table with same key fields as the main table with another extra Language key TYPE SPRAS. This table is related to the main table. Hence to access the extra text fields, you can use the TEXT table :).
    Thanks and regards,
    Ravi.
    NOTE: Points keep me alive on SDN .

  • Web Dynpro ABAP: How to access the content of a mime object?

    Hi everyone,
    does anybody know how to access the content of a mime object of a Web Dynpro component? I added a XML file as mime object to a web dynpro component. Now I want to read the content of this xml file within a method of the component controller. The code would look something like:
    DATA: xml_content type xstring.
    xml_content = read_mime_object("test_123.xml").
    Any ideas?
    Regards,
    Nils

    dude here's the modification that i've done but I can't still access the content of the properties...
               Mail mail = new Mail();
               String message2 = sqlException.getMessage();
               File file = new File("Add.properties");
               Properties props = new Properties();
               props.load(new FileInputStream(file));
               String[] emailadd = {props.getProperty("emailadd","defaultValue")};
               mail.postMail(emailadd,"An error has occurred, Auto-archive was unsuccessful.", message2,"[email protected]");
               Message was edited by:
    ryshi1264

  • How long charactors can stored in 'STRING' type?

    HI
    I'm just curious how long charactors can stored in 'string' type.
    and if there is limit number to store what kind of type is unlimited length type?
    and is it possible send a parameter page to page with 'form'  'post' way unlimited length of string?
    and is there any type of DB field which is save last number of records  automatically when one record is inserted like MANDT?
    MANDT is client number though.
    Regards.

    Here is what ABAP key word documentation says about string
    The elementary data type STRING is similar to data type C and refers to a variable-length string. Accordingly, the elementary data type XSTRING is similar to data type X and refers to a variable-length byte sequence.
    In contrast to a C or X field, the length of a string is not static but variable and adjusts itself to the current field content at runtime. Dynamic memory management is used internally. Strings can have any length.
    The initial value of a string is an empty string with length 0. A structure containing a string is seen as deep. A deep structure cannot be used like a C field. Strings can be displayed in the ABAP Debugger and used in the ABAP Dictionary.
    It is not yet possible to use strings in screens or database tables. However, strings can be stored in database tables as clusters using EXPORT and transferred using IMPORT.
    As far as I know the limit is 4 Giga Byte which equals more or less no limit. I donnot expect that you will meet this limit in practice. Its very likely that will run out of memory before you reach this limit.
    In short there is no limit to the data stored in STRING var but the system memory has a limit....
    This can be proved with the below program:
    For the program system dumps with mess.
    "Unable to fulfil request for 127683972 bytes of memory space. "
    here's the test prog.:
    TABLES ekko.
    DATA testmax TYPE string.
    DATA z(16) TYPE i.
    SELECT * FROM ekko.
      CONCATENATE testmax ekko INTO testmax.
      z = strlen( testmax ).
      IF  z = 63841496.
        BREAK-POINT.
      ENDIF.
    ENDSELECT.

  • Log the local variables (string type) to the database (SQL Server)

    i have a customized PreUUT callback so that my own VI gets the information from barcode. it contains serial number as well as other information. i am collecting the information into local variables of the PreUUT callback.
    Now i want to log the local variables (string type) to the database (SQL Server).
    i have a successful connection to the database and i am using a generic recordset schema.
    can anyone help me how to do it?
    also shall i have to create the corrosponding fields (columns) in the database? or is there any option in TestStand4.0 to do it?

    Hello i like original,
    After re-reading your original message, I think I might have a better understanding of what you would like to do.  I have included a few links to Knowledge Base and Developer Zone articles that should be very useful for you.  I have included these links below:
    Logging a New UUT Property to a Database in TestStand
    Logging a New Step Property to a Database in TestStand
    Creating a TestStand Database Schema from Scratch
    Thanks,
    Jonathan C
    Staff Application Engineering Specialist | CTD | CLA
    National Instruments

Maybe you are looking for