How to insert string

it doesn't work. someone, pls do some correction to my code.
i want: when i click the button, the STRING in TextField is inserted to TextArea.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class MyFrame extends JFrame
{     public MyFrame()
     {     setTitle("I Like Java");
          setSize(500, 300);
          addWindowListener(new WindowAdapter()
          {     public void windowClosing(WindowEvent e)
               {     System.exit(0); }
     Container contentPane = getContentPane();
     JPanel panel = new JPanel();
     JButton saveButton = new JButton("Save");
     panel.add(saveButton);
     saveButton.addActionListener(new ActionListener()
                        // might have problem here
          {     public void actionPerformed(ActionEvent evt)
               {     ta.insert(tf.getText(),0);
     JTextField tf = new JTextField(8);
     panel.add(tf);
     JTextArea ta = new JTextArea(8,40);
     JScrollPane scrollPane = new JScrollPane(ta);
     contentPane.add(panel, "South");
     contentPane.add(scrollPane, "Center");
public class ILikeJava
{     public static void main(String[] args)
     {     JFrame frame = new MyFrame();
          frame.show();
}

still got errors... plss
i have doing this for 4 days...
java.lang.NullPointerException
        at MyFrame$2.actionPerformed(ILikeJava.java:22)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
        at java.awt.Component.processMouseEvent(Component.java:5100)
        at java.awt.Component.processEvent(Component.java:4897)
        at java.awt.Container.processEvent(Container.java:1569)
        at java.awt.Component.dispatchEventImpl(Component.java:3615)
        at java.awt.Container.dispatchEventImpl(Container.java:1627)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
        at java.awt.Container.dispatchEventImpl(Container.java:1613)
        at java.awt.Window.dispatchEventImpl(Window.java:1606)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Similar Messages

  • How to insert String variables in Execute Immediate Statement

    Hi,
    I have query
    dept varchar2(10);
    dept :='electronics'
    l_dyn_sql_input600_cbs := 'select EmployeeName,AGE,' || dept ||' from Employee'
    EXECUTE immediate l_dyn_sql_input600_cbs;
    when i run the query it says "electonics" Invalid identifier.
    Can anyone help to rectify the query

    What are you actually trying to do here:
    - Select employee name, age and the string literal 'electronics' from the employee table?
    - Select employee name, age and the dept field from the employee table?
    - Select employee name, age and dept from the employee table where dept = 'electronics'?
    - Something else...?
    Doesn't seem to make much sense as it is right now...
    cheers,
    Anthony

  • Insert string containing '&'

    How to insert string containing '&' into a table
    INSERT INTO TBL_CHANGES_ORGANISATIES(CHANGE_MANAGEMENT_ID, SUBMITTER) VALUES ('HM0000002147848|TK0000003121328','CS CSU S\&B Change Management')

    if you're in sqlplus:
    put set define offprior to running your insert.
    if you're in Toad, either:
    put set define offbefore your insert statement, and run both in as a script
    OR
    right mouseclick on the editor and untick the "Prompt for substitution variables", and you need never worry about the & again!

  • How to insert some strings in a query with the clausule 'in' in a procedure

    Hello fellows.
    Do you know how to insert some strings in a query with the clausule 'in' in a procedure (with a variable)?.
    I tell us my problem with an example:
    I want to use this select but introducing a variable instead the 'value1', 'value2':
    select * from table1 where field1 in ('value1', 'value2');
    if I declare the variable var1 as:
    TC_VAR1 CONSTANT VARCHAR2(50) := '''value1'',''value2'''
    and I use it as:
    select * from table1 where field1 in (TC_VAR1);
    It doesn't work because Oracle takes TC_VAR1 as an all string. I think Oracle takes it as this:
    select * from table1 where field1 in ('value1, value2');
    If I use the data type TABLE, I don't know how to use well:
    TYPE varchar2_table IS TABLE OF VARCHAR2(10);
    tb_var varchar2_table;
    select * from table1 where field1 in (tb_var);->It returns an error and there ins't an method that it returns all values.
    A curious case is that if I have a sql script (for example script1.sh) with this query:
    select * fromt able1 where field1 in (&1)
    and I invoke this script as
    script1.sh "'''value1'',''value2'''". It works
    Can anybody helps me?.
    Thanks.

    Thanks to all. Really.
    First, sorry for my English. It's horrible. Thank to all for understand it (my English).
    I've resolved my problem with these links:
    ORA-22905: cannot access rows from a non-nested table item
    and
    http://stackoverflow.com/questions/896356/oracle-error-ora-22905-cannot-access-rows-from-a-non-nested-table-item
    At last, I have used someting like this:
    DECLARE
    number_table_tmp NUM_ARRAY:=NUM_ARRAY(410673, 414303, 414454, 413977, 414042, 414115, 413972, 414104, 414062);
    BEGIN
    FOR c1 IN (SELECT par_id, 1 acc_vdo_id FROM SIG_VIS_CAM
    WHERE par_id IN (SELECT * FROM TABLE(number_table_tmp))
    UNION ALL
    SELECT par_id, 2 acc_vdo_id FROM SIG_ACCAO a
    WHERE par_id IN (SELECT * FROM TABLE(number_table_tmp))) LOOP
    NULL;
    END LOOP;
    END;
    but first I had to create the type NUM_ARRAY like this:
    CREATE TYPE subjectid_tab AS TABLE OF NUMBER INDEX BY binary_integer;
    THANK YOU, GUYS. YOU ARE THE BESTS. ;-)
    Edited by: user12249099 on 08-sep-2011 7:37
    Edited by: user12249099 on 08-sep-2011 7:37

  • How to insert int type array value to String type value?

    public class wood
         public static void main (String args[])
              int a[]={1};
              String b[]={" "};
              b=a[0];
    }how can I do it??I know it is int type, but how to insert a[0] to b[0]?

    I don't understand this statement.
    What I want to know is
    1) why are you trying to convert an int[] to a String[]
    2) are you trying to convert from a int[] to String[] or from an int[] to a String (i.e. treating the ints as chars or even simply concatenating there String values to a single String) and , once again why
    There is probably a better way to accomplish your goals, but without cleary stating your goals we cannot help you. And as far as there being multiple int values, so what, the code snippet I posted would work for a hundred int values, you would just need to make the String[] long enough and loop through the values, you can't just simply do it all at once (unless of course, they are to be treated as char values, in which case you can probably cast your int[] to a char[] and use new String).

  • How to insert check box fields in a htmlb: tableview

    Hi,
    Can anybody tell me how to insert check box fields in a htmlb: tableview in a sequence of rows in a table view. How to generate the sequence no for the checkbox inorder to know the row that is checked.
    Thanks in advance,
    Aruna.

    Here is the code which has the custom "Checkbox" in the tableview & Triggers the event. <b>You can identify the checkbox based on cell ID (p_cell_id)</b> in the method "IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START" & Based on the event name + Cell ID. Look at the code & let me know if you any issue.
    <b>Layout:</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content id               = "content"
                   design           = "design2002+design2003"
                   controlRendering = "SAP"
                   rtlAutoSwitch    = "true"
                   forceEncode      = "ENABLED" >
      <htmlb:page title="Test " >
        <htmlb:form>
          <%
      data TV_ITERATOR Type Ref To zcl_itr.
      data iterator type ref to IF_HTMLB_TABLEVIEW_ITERATOR.
      create object tv_iterator exporting appl_cons = application.
      iterator = tv_iterator.
          %>
          <htmlb:tableView id              = "fligts"
                           headerText      = "Flight"
                           width           = "100"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "10"
                           fillUpEmptyRows = "true"
                           showNoMatchText = "true"
                           filter          = "server"
                           sort            = "server"
                           onHeaderClick   = "MyEventHeaderClick"
                           table           = "<%= APPLICATION->itab %>"
                           iterator        = "<%= ITERATOR %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>Event Handling:</b>
    DATA: EVENT_ID1 TYPE REF TO IF_HTMLB_DATA.
    EVENT_ID1 = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
    CASE EVENT_ID1->EVENT_SERVER_NAME.
    IF NOT event_id1 IS INITIAL.
       if event_id1->server_event+0(9) = 'chkevent'.
      SPLIT event_id1->server_event AT '-' INTO v_event v_dummy v_row v_col.
      endif.
    endif.
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
         CLEAR p_column_definitions.
        CLEAR p_overwrites.
        DATA: tv_column  TYPE TABLEVIEWCONTROL.
        tv_column-COLUMNNAME  = 'FLDATE'.
        tv_column-edit        = 'X'.
        tv_column-sort        = 'X'.
        tv_column-TITLE               = 'Flight Date'.
        tv_column-WIDTH  = '100'.
        APPEND tv_column TO p_column_definitions.
        CLEAR tv_column.
        tv_column-edit        = 'X'.
        tv_column-COLUMNNAME          = 'CONNID'.
        tv_column-TITLE               = 'Conn.ID'.
        tv_column-WIDTH  = '70'.
        tv_column-HORIZONTALALIGNMENT = 'center'.
        APPEND tv_column TO p_column_definitions.
        CLEAR tv_column.
        tv_column-edit        = 'X'.
        tv_column-COLUMNNAME          = 'CHECKBOX1'.
        tv_column-TITLE               = 'Check Box'.
        tv_column-WIDTH  = '30'.
        tv_column-HORIZONTALALIGNMENT = 'center'.
        APPEND tv_column TO p_column_definitions.
    endmethod.
    METHOD IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
           DATA: L_EVENT TYPE STRING.
      CASE P_TABLEVIEW_ID.
        WHEN 'fligts'.
          CASE P_COLUMN_KEY.
            WHEN 'CHECKBOX1'.
    *          CONCATENATE 'chk_event' '123' '2323' INTO L_EVENT SEPARATED BY '-' .
    CONCATENATE 'chkevent' p_cell_id INTO l_event SEPARATED BY '-'.
              P_REPLACEMENT_BEE = CL_HTMLB_CHECKBOX=>FACTORY( ID = P_CELL_ID
            ONCLICK = L_EVENT CHECKED = 'false' ).
          ENDCASE.
      ENDCASE.
    ENDMETHOD.
    Hope this will solve your problem.
    <b><i>* Reward each helpful answer.</i></b>
    Raja T
    Message was edited by:
            Raja T

  • How to insert new line in a text file

    hi all,
    i wnat to know how can i insert a new line in a text file using java.
    for example i want the formate of the text like this
    1 2 3
    4 5 6
    until now i know only how to insert data but not new line.
    Thanks in advandce

    Hi you can put a new line in a text file using System.getProperty("line.separator"). This implementation will work for every OS.
    import java.io.*;
    class Demo{
    public static void main(String args[]) throws Exception {
    FileWriter fr = new FileWriter("FileDemo.txt");
         fr.write("AAAAAAAAAA");
    fr.write(System.getProperty("line.separator"));
    fr.write("AAAAAAAAAAA");
    fr.close();
    }

  • How to Insert more than one record at a time- with fixed set of values in one field

    Can someone guide as to how to insert multiple records at a time using ASP VBScript in Dreamweaver CS4 or ADDT.
    If someone can guide then the exact problem is given below.
    I have a MS access database with one table. The table has three fields. The first field is an autonumber field for ID number.
    The second field contains string values- One out of 7 predefined values. One set of records consists of 7 records containing all the seven types of predefined values in fields no 1.
    The third field is a numeric field and can contain integers.
    I want that the user can enter data for the table using an ASP form in such a way that he enters one set of records at a time in one single screen. This way he will not have to remember that he has /has not entered all the seven set of values for the field no 1.
    I am not creating fields with the 7 types of field1value as their names as it will increase the number of fields drastically.
    Please help for dreamweaver ASP VBScript.

    I have successfully inserted seven records in one form submit operation by looping through the command object execute method.
    However, the data that is being inserted by the command object is repetition of the first record and the command object is not taking any data from the text boxes for the second record onwards. In this I had used the isert record behavious generated by DW CS4 and modified it to suit my requirement. However, the data inserted in the first row is getting repeated in all the seven rows.
    Please help.
    Also advise if there are any free dreamweaver server side validation extensions available.

  • How to Insert more than one record at a time

    How to insert multiple records at a time?
    If someone can advise on this, then the actual problem is described below:
    I have a MS access database with one table. The table has three fields. The
    first field is an autonumber field for ID number.
    The second field contains string values- One out of 7 predefined values. One
    set of records consists of 7 records containing all the seven types of
    predefined values in fields no 1.
    The third field is a numeric field and can contain integers.
    I want that the user can enter data for the table using an ASP form in such
    a way that he enters one set of records at a time in one single screen. This
    way he will not have to remember that he has /has not entered all the seven
    set of values for the field no 1.
    I am not creating fields with the 7 types of field1value as their names as
    it will increase the number of fields drastically.
    Please help with inserting multiple records at a time.

    I have successfully inserted seven records in one form submit operation by looping through the command object execute method.
    However, the data that is being inserted by the command object is repetition of the first record and the command object is not taking any data from the text boxes for the second record onwards. In this I had used the isert record behavious generated by DW CS4 and modified it to suit my requirement. However, the data inserted in the first row is getting repeated in all the seven rows.
    Please help.
    Also advise if there are any free dreamweaver server side validation extensions available.

  • How to insert data in a one-to-many relationship

    How do you insert data into the client, my model entity beans have a one-to-many relationship.
    PARENT ENTITY BEAN
    PARENT-ID
    PARENT-NAME
    The ejbCreate(Integer parentID,String name)
    CHILD ENTITY BEAN
    CHILD-ID
    CHILD-NAME
    PARENT-ID(foreign key of PARENTID).
    ejbCreate(Integer parentID,String name,String foreignparentID)
    In a jsp page i collect the parent details and 3 corresponding chld details in a text box.
    Can you please tell me how do i proceed from here...
    ie. how to i insert data into the entity beans..
    Do i pass the child as a collection, and within parents ejbCreate() method do i lookup for the childs home interface and insert one -by -one from the collection.
    1. Considering the above example, can some one pls tell how the ejbCreate() mehod signatures, for the parent and child entity beans should be.
    2. Pls also show some sample client code as to how to make an insertion.
    3. In case you are passing a collection of child data, then in what format does one have to insert into a collection and also how does the container know how to insert the values in the child table , bcoz we are passing as a collection.
    4.In case collections cannot be inserted do we need to iterate into the collection in parent's ejbCreate() method, and manually insert into the database of the childtable, thereby creating child entity beans.
    Thanks for your time and support...
    regards
    kartik

    Hi,
    3. In this case of course child's ejbCreate(and postCreate) looks like
    ejbCreate(Integer childID,String name,ParentLocal parent) {
    setId(Id);
    setName(name);
    ejbPostCreate(Integer childID,String name,ParentLocal parent) {
    setParent(parent);
    Here you don't need IDs, but it happens only using Locals, not Remotes, if I'm not wrong. Container does it itself.
    1. Of course, if you have parent.getChildren() and parent.setChildren() then you don't need any loops, but it should be done anyway in postCreate, because in ejbCreate there no parent exists yet.
    Once more 3: example - I'm using JBoss 3.2.5 as EJB container. It has tomcat inside and EJB and JSP+Struts use the same jvm. It means for me that I don't need to use remote interfaces, just locals. And in this case I can implement ejb-relations. So, a have the abstract method parent.getChildren() which returns Collection of ChildLocal - s and method parent.setChildren(Collection childrenLocals) which creates/modifies children by itself.
    I have not used remotes for a long time, but as I remember it was not possible to implement ejb-relations using remotes.
    regards,
    Gio

  • How to insert a word document or an RTF document into RichTextEditor?

    How to insert a word document or an RTF document into af:richTextEditor. I am using Apache POI for reading the Word document and getting its contents. I am able to display the whole content of the document except the table and image within the document. The data in the table is getting displayed as a string and not as a table inside the editor.
    Can we insert a word/RTF document into a rich text editor?
    Can we insert images into the rich text editor?
    The following is the code that I used. On clicking a button the word document has to be inserted into the <af:richTextEditor>.
    <af:richTextEditor id="rte1" autoSubmit="true"
    immediate="true"
    columns="110" rows="20">
    <af:dropTarget dropListener="#{SendEmail.richTextEditorDrop}">
    <af:dataFlavor flavorClass="java.lang.String"/>
    </af:dropTarget>
    </af:richTextEditor>
    <af:commandButton text="Insert at position" id="cb2">
    <af:richTextEditorInsertBehavior for="rte1" value="#{RichTextEditorUtil.docFile}"/>
    </af:commandButton>
    Java Code: I am using Apache POI for reading the word document.
    import org.apache.poi.hwpf.HWPFDocument;
    import org.apache.poi.hwpf.extractor.WordExtractor;
    public String getDocFile() {
    File docFile = null;
    WordExtractor docExtractor = null ;
    WordExtractor exprExtractor = null ;
    try {
    docFile = new File("C:/temp/test.doc");
    //A FileInputStream obtains input bytes from a file.
    FileInputStream fis=new FileInputStream(docFile.getAbsolutePath());
    //A HWPFDocument used to read document file from FileInputStream
    HWPFDocument doc=new HWPFDocument(fis);
    docExtractor = new WordExtractor(doc);
    catch(Exception exep)
    System.out.println(exep.getMessage());
    //This Array stores each line from the document file.
    String [] docArray = docExtractor.getParagraphText();
    String fileContent = "";
    for(int i=0;i<docArray.length;i++)
    if(docArray[i] != null)
    System.out.println("Line "+ i +" : " + docArray);
    fileContent += docArray[i] + "\n";
    System.out.println(fileContent);
    return fileContent;

    Hi,
    images are not yet supported. Its an open enhancement request for the rich text editor.
    For tables, it seems they are supported but in a basic way (just HTML 4 style) if I interpret the tag documentation correct
    http://download.oracle.com/docs/cd/E15523_01/apirefs.1111/e12419/tagdoc/af_richTextEditor.html
    Frank

  • How to insert a image file into oracle database

    hi all
    can anyone guide me how to insert a image file into oracle database now
    i have created table using
    create table imagestore(image blob);
    but when inserting i totally lost don't know what to do how to write query to insert image file

    Hi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
    Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
    out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
    out.println("   <input type='submit' name='submit' value='Submit' class='smalltext'>");
    out.println("</form>"); Import this once you have the jar file:
    import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
    private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
            boolean result = true;
            String fileName = null;
            byte fileData[] = null;
            String fileUploadError = null;
            String imageType = "";
            String error = "";
            DiskFileUpload fb = new DiskFileUpload();
            List fileItems = fb.parseRequest(request);
            Iterator it = fileItems.iterator();
            while(it.hasNext()){
                FileItem fileItem = (FileItem)it.next();
                if (!fileItem.isFormField()) {
                    fileName = fileItem.getName();
                    fileData = fileItem.get();
                    // Get the imageType from the filename extension
                    if (fileName != null) {
                        int dotPos = fileName.indexOf('.');
                        if (dotPos >= 0 && dotPos != fileName.length()-1) {
                            imageType = fileName.substring(dotPos+1).toLowerCase();
                            if (imageType.equals("jpg")) {
                                imageType = "jpeg";
            String filePath = request.getParameter("FILE_PATH");
            session.setAttribute("filePath", filePath);
            session.setAttribute("fileData", fileData);
            session.setAttribute("fileName", fileName);
            session.setAttribute("imageType", imageType);
            return result;  
         } And now finally the method to actually write the file to the database:
    private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
            //If the previous code found a file that can be uploaded then
            //save it into the database via a pstmt
            String sql = "";
            UtilDBquery udbq = getUser(request).connectToDatabase();
            Connection con = null;
            int signatureID = 0;
            PreparedStatement pstmt = null;
            try {
                udbq.setUsePreparedStatements(true);
                con = udbq.getPooledConnection();
                con.setAutoCommit(false);
                if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
                    sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
                    pstmt = con.prepareStatement(sql);
                    ResultSet rs = pstmt.executeQuery();
                    while(rs.next()) {
                       signatureID = rs.getInt(1);
                    if (fileName != null && imageType != null) {
                        sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setInt(1, signatureID);
                        pstmt.setBinaryStream(2, is2, (int)(fileData.length));
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
                if(mode.equals("U") && signatureIDIn != 0) {
                    signatureID = signatureIDIn.intValue();
                    if (fileName != null && imageType != null) {
                        sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
                        InputStream is2 = new ByteArrayInputStream(fileData);
                        pstmt = con.prepareStatement(sql);
                        pstmt.setBinaryStream(1, is2, (int)(fileData.length));
                        pstmt.setInt(2, signatureID);
                        pstmt.executeUpdate();
                        pstmt.close();
                        con.commit();
                        con = null;
            } catch (Exception e) {
                con = null;
                throw new Exception(e.toString());
            return signatureID;
       }

  • How to insert a blank value in not nul column using transform activity

    can anyone help me on how to insert blank values in a not null column using transform activity or however possible..This is a requirement in my project ..

    vidya
    In DB adapter or-mappings.xml , did you made any changes. If not the open that file in any notepad editor and change the following
    <attribute-mapping xsi:type="direct-mapping">
    <attribute-name>director</attribute-name>
    <field table="MYTABLE" name="MAKE_IT_BLANK_NOT_NULL" xsi:type="column"/>
    <attribute-classification>java.lang.String</attribute-classification>
    </attribute-mapping>You can try to add this:
    <attribute-mapping xsi:type="direct-mapping">
    <attribute-name>director</attribute-name>
    <field table="MYTABLE" name="MAKE_IT_BLANK_NOT_NULL" xsi:type="column"/>
    <null-value></null-value>
    <attribute-classification>java.lang.String</attribute-classification>
    </attribute-mapping>Refer below link for details
    Re: Insertion of Blank value to a Not Null varchar column in SQL server table
    Thanks
    AJ

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

  • Inserting String  in a Table

    Hi all
    i have to insert the String Value ( the user doesn't login) in a varchar Field in the table
    the Apastphi is in between the String,
    How to insert these kind of values in the Insert Statement
    please Help
    thanks a lot

    Are you looking out for this:
    C:\>sqlplus /nolog
    SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jul 21 19:10:13 2009
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    SQL> conn sys@dbbsl as sysdba
    Enter password:
    Connected.
    SQL> drop table test;
    Table dropped.
    SQL> create table test (name varchar2(45));
    Table created.
    SQL> insert into test values('Santosh'||chr(39)||'s Demo.');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from test;
    NAME
    Santosh's Demo.
    SQL>Regards,
    S.K.

Maybe you are looking for

  • Adobe Media Encoder cuts off video layer when the Ultra Key effect is applied

    I am working on a Mac (10.8.5) using the latest verison of Premiere Pro CC. I am using Ultra Key to remove the chroma key background from the "talent layer" and adding a "new background layer" behind the talent video layer. When I export directly fro

  • Workflow for payment release doesn't block the FI Document by tnx MIRO

    Hi Gurus, we are implementing the Workflows for all the Payable Accounts, we don't have problem with txn FB60, the documents posted are automatically blocked but with txn MIRO it doesn't happen. In customizing I set the "RE" Class Document (Invoice V

  • Forbid a user group to modify an specific metadata field??

    Is it possible to forbid a user group to MODIFY an specific metadata field or group of fields? I know you can create a new metadata SET and forbid the user group to modify the entire set, but what about groups or fields?? Any help is welcome

  • Renting movies from my ipod touch

    I tried renting a movie on my ipod touch. I clicked "rent" which was interrupted by a new set of terms and conditions. After agreeing to the terms and conditions it told me to try my rental again so I did. My account has been debited for 2 movie rent

  • I am having trouble installing flash player on mac

    I have been trying to install flash player on my mac several times, without success. I have ran the uninstall program a few times and it still doesn't work. Help!!