Saving ' in database

I have a description field. Need to allow to save ' in the description.
I have the following statements:
String str = "insert into table (Description) values (" +
"'" + desc + "')" ;
where desc is the value inputted by the user.
In case the user enters ' in the desc exampe test'description. I get an error. How do I allow to save the quote.

try this one:
     StringBuffer sb = new StringBuffer();
     PreparedStatement pre = null;                    
          sb.append("insert into table ");
          sb.append("(Description) values ( ?) ");
          pre = conn.prepareStatement(buf.toString());
          pre.setString(1, "'desc");               
          pre.executeUpdate() ;
or
     StringBuffer sb = new StringBuffer();
     PreparedStatement pre = null;                    
     sb.append("insert into table (Description) values ( ?) ");
     pre = conn.prepareStatement(buf.toString());
     pre.setString(1, "'desc");          
     pre.executeUpdate() ;
This should work. I usually follow the above style.

Similar Messages

  • How to move worksheet saved on database from one instance to another?

    Hi Every one,
    How to move worksheet or workbook saved on database from Discoverer plus from one instance to other instance?
    Is there any way to save a workbook or work sheet on to local drive from discoverer plus.?
    Thanks
    santhosh

    Hi,
    You have 2 options: use Discoverer Administrator to export/import the workbook; or use Discoverer Desktop to save the workbook to the local drive.
    You cannot save a workbook to the local drive using Discoverer Plus.
    Rod West

  • How to make the fields of BPM object not saved in database.

    Is it possible to declare some attributes of BPM object not saved in database.
    For example: Order has attribute orderId and date, user (other attributes)... we only want OBPM save orderId. We want the other attributes could be saved and retrieved by external DAO classes.
    We still want to use the OOTB presentation from BPM object (not the customer jsp).
    Thanks

    When you say:
    Is it possible to declare some attributes of BPM object not saved in database.do you mean you do not want the information stored in the Oracle BPM Engine's database?
    If this is the case, create a BPM Object with just two attributes. One would store your orderId as a primitive data type. The other attribute would be a BPM Object that would store all the other data you are going to retrieve from the external database.
    At the beginning of the screenflow, read the database using the orderId attribute and populate the other attribute (the BPM Object). At the end of the screenflow just before it flows to the end activity, you could set the second attribute (again, the BPM Object attribute) to null. This would keep the BPM object with the two attributes from storing anything but the orderId in the Engine's database table for the work item instance.
    Dan

  • Text fields populated from lov mapping are not saved to database

    Hi Everyone,
    I'm having a wierd problem. My requirement is to autopopulate two text fields field 2 and field 3 when a value is selected from lov in field1 and save all the values to database on click of a submit button.
    Using lov mapping i'm able to populate field 2 and field 3 with corresponding values based on the value selected in field1. And also field2 and field3 should be in the readonly mode so that user cannot change the value.
    So to make the fields readonly i have changed the property of readonly to true for field2 and field3. But if I change the readonly property, the values for field2 and field3 are not being saved to database.
    The values are getting saved to database only when readonly = true for messageTextInput item type or if the item type is a form value.
    I also tried disable = true, which also didnt work.
    I tried to debug by writing some sop statements in PFR, but these statements also returned null for pageContext.getParameter("field2") etc;
    Can anyone please tell me how to solve this problem?
    Thanks
    Sunny

    Hi Gyan,
    I forgot to mention that , I also tried messageStyledText. Which also didn't work. I wanted to use vo.setAttribute as my last option, but i wanted to understand why the values are not saved to database when the text item is showing the values on the page.
    Thanks
    Sunny

  • Workflow message modifications not getting saved into database

    Hello Friends,
    I am working on iProcurement module (11i) and have a requirement to remove the 'View' & 'Edit' links which appear in notification/Emails in Requisition Approval Workflow.
    I found a metalink note "How to Remove Related Application Links From Approval Notifications for AME [ID 1100805.1]" for the same.
    We have to delete some attributes from the workflow message to remove the links but the same is not getting saved in database.
    I am uploading the wft file through Workflow Definition Loader program with the 'force' option. And to check the changes , i am again downloading the file but i could not see the changes.
    Can't attributes be deleted from the message?
    Any suggestions ?
    Thanks...
    Regards,
    Amit

    Hi Hussein,
    Thanks.
    Here are the details :
    RDBMS : 11.2.0.2.0
    Oracle Applications : 11.5.10.2
    OS : Windows XP
    Log :
    Concurrent request completed successfully
    Current system time is 01-DEC-2011 08:29:12
    Oracle Workflow Definition Loader 2.6.4.0.
    Access level: 20, Mode: FORCE
    Uploaded 3 ITEM_TYPE record(s) to database.
    Uploaded 55 LOOKUP_TYPE record(s) to database.
    Uploaded 32 MESSAGE record(s) to database.
    Uploaded 182 ACTIVITY record(s) to database.
    Uploaded 0 ROLE record(s) to database.
    Regards,
    Amit

  • Uploading a file to be saved in database

    Hi all,
    I have a web application which users access through browser. There is a screen where I list certificates of a person from database. My requirement is that for a particular certificate, user will select a file and click Attach button. I then need to upload this file and saved in database for that certificate.
    What are the steps involved in uploading a file to be saved in database?
    <form>
    <input type="hidden" name="certificate_id" />
    <input type="file" name="certificate_file" />
    <input type="submit" value="Attach" />
    </form>Edited by: srhcan on Jun 16, 2012 8:48 AM

    Thanks guys for your help.
    My environment is Eclipse Indigo and JBoss 4.2.0. I have created a simple web application in to test Apache Commons FileUpload. This app consist of just one jsp and one servlet. The jsp has the input type file and is submitted to the servlet. The servlet prints out the file info. The 2 Commons jars fileupload and io are in WEB-INF\lib folder.
    I have tested it successfully when I run the Jboss from within Eclipse.
    But when I run the JBoss outside of Eclipse, I get this error message from servlet:
    2012-06-19 19:54:55,405 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[TestFileUpload].[FileUploadServlet]] Servlet.service() for servlet FileUploadServlet threw exception
    java.lang.UnsupportedClassVersionError: Bad version number in .class file
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1817)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1325)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:199)
         at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:361)
         at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
         at com.abc.servlet.FileUploadServlet.doPost(FileUploadServlet.java:59)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:595)
    What could be the reason?
    This is the servlet:
    package com.abc.servlet;
    import java.io.IOException;
    import java.io.InputStream;
    import java.util.Iterator;
    import java.util.List;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.FileItemFactory;
    import org.apache.commons.fileupload.FileUploadException;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    * Servlet implementation class FileUploadServlet
    public class FileUploadServlet extends HttpServlet {
         private static final long serialVersionUID = 1L;
         * @see HttpServlet#HttpServlet()
        public FileUploadServlet() {
            super();
            // TODO Auto-generated constructor stub
          * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              // TODO Auto-generated method stub
          * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              boolean isMultiPart = false;
              try {
                   // Check that we have a file upload request
                   isMultiPart = ServletFileUpload.isMultipartContent(request);
                   System.out.println("isMultiPart=" + isMultiPart);
                   if (isMultiPart) {
                        // Create a factory for disk-based file items
                        FileItemFactory fileItemFactory = new DiskFileItemFactory();
                        // Create a new file upload handler
                        ServletFileUpload servletFileUpload = new ServletFileUpload(fileItemFactory);
                        List fileItemsList = servletFileUpload.parseRequest(request);
                        FileItem fileItem = null;
                        String fileName = null;
                        InputStream inputStream = null;
                        long inputStreamSize = -1;
                        Iterator iter = fileItemsList.iterator();
                        while (iter != null && iter.hasNext()) {
                             FileItem fileItem1 = (FileItem) iter.next();
                             System.out.println("---fileItem1.isFormField()=" + fileItem1.isFormField());
                             if (fileItem1.isFormField()) {
                                  String fieldName = fileItem1.getFieldName();
                                  String fieldValue = fileItem1.getString();
                                  System.out.println("fieldName=" + fieldName);
                                  System.out.println("fieldValue=" + fieldValue);
                             } else {
                                  fileItem = fileItem1;
                        fileName = fileItem.getName();
                        inputStream = fileItem.getInputStream();
                        inputStreamSize = fileItem.getSize();
                        System.out.println("fileName=" + fileName);
                        System.out.println("inputStream=" + inputStream);
                        System.out.println("inputStreamSize=" + inputStreamSize);
                        inputStream.close();
                        System.out.println("inputStream closed");
              } catch (FileUploadException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Edited by: srhcan on Jun 19, 2012 8:04 PM

  • Multi line custom field badly saved to database

    Hello community,
    we're fighting currently against a strange issue.
    All projects has some multi line custom fields to fill every week for project status.
    During this exercise, some of the comments seems not well saved to database.
    While coming back to the PDP, we are seeing a strange behavior :
    Starting from that, I tried to look in the database and the saved html format is badly formatted, you can see a </div> in the middle and a missing one at the end of the sentence:
    <div>Révision et approbation de l&#39;ODS de Facilité.</div> <div>&#160;</div></div> <div>Compléter&#160;le questionnaire à soumettre aux experts.</div>
    <div>&#160;</div> <div>Présentation et choix des experts.
    As of now, we did not find any reason why this is happening.
    While opening back the PDP in edition and saving back ,the problem is solved.
    This is annoying because we are treating the html code as xml for reporting as seen here (http://aboutmsproject.com/converting-rtf-to-text-in-sql-revisited/
    ) and this is crashing because of badly formatted html code
    any advices?
    regards
    Jérome

    Hi Jerome,
    I've seen this issue occur when text is pasted into the field from other applications, like Outlook and Word. I've not yet been able to determine how to get it to stop. The error then causes the invalid XML issue you are seeing. A former co-worker had successfully
    integrated the use of jQuery into PDPs. I'm wondering if they have a HTML clean function.
    Thanks for finding my post useful!
    Treb Gatte, Project MVP, Tumble Road LLC |
    @tgatte | http://AboutMSProject.com

  • Adobe Forms - Table control data Saved in Database table through Web Dynpro

    Hello Friends,
    I Am facing a Problem in Adobe Forms through Web Dynpro.
    i Want to Make Interactive online Adobe Forms - In Table Control user enter the multiple entry in the table control and after that Click on SAVE button , entry will saved in Database table.
    Please guide me.
    Thanks in advance.
    Gaurav.

    Hi Gaurabh,
    For interactive form you have to check the property DisplayType = native and PdfSource should be a Context Attribute of type 'Xstring'.
    For data retrieval, create a NODE and have all the required attributes within that node of AOBE form.
    Fetch the data in WDDOINIT.
    Also check, that the offline senario for this form is working.
    Hope it helps you.

  • Want User Exist or BADI when PO created and saved in database

    Hello Experts,
        I want User Exists or BADI, when PO saved in database table. That is, after Successfully Created message, want user exist or BADI in 4.7 server.
    Thanks & Regards,
    Poonam.

    Hi Friend ,
    Here is the  User Exit & BADI for Purchase Order  on save .I hope it will solve your Query
    User exit  create project  in CMOD : MM06E005
    BADI in SE18 :  ME_PROCESS_PO_CUST
    For more Information please see this SDN LINK : [ME21N /  ME22N SAVE Userexit;
    Regards,
    Edited by: Loganathan girishkumar on Nov 5, 2009 4:31 AM

  • Where does reports get saved in Database

    Hi
    Can anyone please tell me
    1) Where does exactly (in which table) Reports get saved in Database.
    2) Where does Business Area and Its folders get saved in database
    3) How can I modify look and feel and Customize toolbar in discoverer Plus/Viewer other than the default colour scheme provide by discoverer itself.
    Thanks

    Hi
    Though others have answered your first two questions, I would even question why you need to know the exact location / table where these objects get stored.
    You cannot customize the toolbar in Plus - you can change the look and feel by changing the LAF that applies to Plus. To do this, go to the App Server Control (AS Control > Discoverer > Discoverer Plus > Look and Feel) and you can select from one of three out-of-the-box LAFs: System, Plastic, Browser, and Oracle. You can also create your own LAF.
    For Viewer, you can use the App Server control to customize the Look And Feel as well as the Layout of Viewer.
    Thanks
    Abhinav
    Oracle Business Intelligence Product Management
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    Discoverer: http://www.oracle.com/technology/products/discoverer/
    BI Software: http://www.oracle.com/technology/software/products/ias/devuse.html
    Documentation: http://www.oracle.com/technology/documentation/appserver1012.html
    BI Samples: http://www.oracle.com/technology/products/bi/samples/
    Blog: http://oraclebi.blogspot.com/

  • FMB saved in database

    Hi Guru,
    I have been save FMB file into database, and have some problems
    - I dont know how to run the FMX. Can I used ifrun60.exe?
    - How to deploy to my client
    - What the benefits if save into database
    Thanks for help me.
    Guntur Kosasih
    null

    Kosasih
    you can only save fmb in database, but you need to produce fmx file with form builder or form compiler. You cannot run form saved from database.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by guntur kosasih ([email protected]):
    Hi Guru,
    I have been save FMB file into database, and have some problems
    - I dont know how to run the FMX. Can I used ifrun60.exe?
    - How to deploy to my client
    - What the benefits if save into database
    Thanks for help me.
    Guntur Kosasih
    <HR></BLOCKQUOTE>
    null

  • How to Refresh a Page once saved to database in ADF.

    Hi,
    I created a JSF page using project template as "JSF,ADF,business components".
    There is a List of values displayed in a dropdown list,
    User can create new value and once it is saved to the database it should reflect in the list of values.But it is not displaying in the LOV and it is happening only when i close that page and open a new one.
    Can u please tell me how to refresh a page without closing the current page once save button is clicked.
    Thank you,
    Harika.

    Mini wrote:
    Hi Hari,
    Yes i have a apex page redirects from the ebs menu like you said. But for the refresh issue instead of modifying in the jsp i thought of bringing the automatic refresh for that apex page once it is loaded within apex.
    However these type of issues are sometimes get fixed by clearing browser cache or just by restarting your browser. Have you tried it?Yes i have tried, by clearing the browser cache and also by restarting the browser then too it still persist.
    Any DA action will be helpful for refreshing that page for 1sec once it is loaded. Since i dont want it to be loaded multiple times often once it is loaded.
    The refresh has to be only once if the page is loaded.
    or is it possible to Refresh the page based on the application page item through DA
    Thanks
    Brgds,
    MiniTechnically Yes, you can create a D.A. that will fire only once based on some apex page item or application item value. However this is NOT the correct solution.
    <li> When you see apex page (after clicking menu in EBS), do you see apex url in browser address bar? Can you post the URL here?
    <li> If you directly log-in to APEX (not via EBS), do you still face this issue?
    Regards,
    Hari

  • File Upload - When  is File saved in database

    Hi,
    I'm already using File Upload and Download in my application, which is working fine.
    Now I only need an information for better understanding.
    Is the file saved in the database table, when user selects the file from the file browse dialog or is it submitted when the user submits the page?
    Normally I'm using a lot of AJAX in my page, because of this I've no page process started on submit, I call javascript, that's calling processes on demand. Will my files be uploaded???
    Thanks
    chrissy

    Hello Chrissy,
    Never uploaded “regular” files into the db, only XML files, so I don’t have much experience working with BLOB, but please check if the following can help you - Re: Download an upload from Server directory
    In addition, Vikas wrote an application, which uploads CSV files directly into a table. The code can be downloaded in here - http://htmldb.oracle.com/pls/otn/f?p=38131:1
    >> I've found packages called WWV_FLOW_FILE_API and WWV_FLOW_FILE_MGR
    IMHO, you should try, as much as possible, to avoid using undocumented APEX internal packages, as they are subject to possible changes in future versions. If you can achieve your goals using public packages, and I’m pretty sure you can, it would be best.
    Hope this helps,
    Arie.

  • HELP: Formula Item data is not saved to database

    Hi:
    I've added a formula in a database item but when i commit the form the data is not saved to the database. When i am working on form the item reflects the formula value, but when i commit the value is not stored in the database.
    I need urgent help.
    Thanks
    Joao Oliveira

    It is not clearly stated in the help file I agree. With a little PLSQL code you could copy the item to a hidden database field and have it be saved to the database. See Note 43012.1 on Metalink for details.

  • Organize discoverer workbooks saved to database

    I may be confusing this with another Oracle product, but I seem to recall hearing something about an enhancement to Discoverer relational that would allow creation of folders/directories to help organize workbooks when saving to the database. Has anybody heard about any such plan?
    Thanks in advance.
    Cheers,
    Burt

    As of now, you can't do that.
    However there has been a 'tickler' statement that it might be coming up in the next version due the end of 2007.
    So ... stayed tuned to see!
    Russ

  • Master-Detail Form - only the first detail record is saved in database

    Hello,
    I have created APEX master-detail form with detail tabular form on the same page.
    I tried to enter data to the several detail rows (using Add Row button) and then press Apply Changes button.
    Unfortunately, only the first detail row is being inserted into the database.
    What could be the reason?
    Thanks in advance,
    Erik

    Hi,
    I had a similar problem.
    Problem with addRow(); function in tabular forms - only first line saved
    Maybe it will help to you.
    Regards
    J :D

Maybe you are looking for

  • I have DELETED calendars showing in my iTunes Sync Calendars list!?

    iMac late 2009 OSx 10.10.2 iPhone 6 Plus iOS 8.1.3 Completely Up to Date! no clouds involved, no calendar subscriptions. I have had a major problem with my Calendar's calendars, which I have completely repaired using Calendar.  During that process, I

  • Can we use BLOB fields (that store images) in Crystal Report ?

    I'm developing with ASP.NET, VS.NET 2003. Using Crystal Report for VS.NET DataBase: Oracle 10g I store a BLOB field in a table. This field store images, like jpg files. The Stored Procedure that I use to fill the report is: OPEN MyCursor FOR SELECT M

  • Phone will not sync with iTunes (5 and 6)

    I posted this about a month ago and didn't get any help. Maybe a second time around will do the trick. Below is the original question. I don't want to keep restoring my phone to factory settings in order to sync music, so any other insight would be h

  • Vertical streaks and bad skin color

    The print is not very clear....it has vertical streaks and the skin color is mostly red. Thanks for your help!

  • I can't resize my wallpaper in iOS 7

    I want to resize my wallpaper and move it around but this new software won't let me.  Can anyone help or is this just a glitch in this new system