Escaping characters on help page

I would like to escape some html-code I'm placing on a help region. Is that possible? How is the escaping for escaped html region implemented? Can I use the same API?

No, that does not help. I want it to show up in the webpage. So I want to be able to write some htmlcode on the page and display the actual html code for the reader. The comment would just make it not interpreted by the browser, but it would not show up on the webpage.
In this case it is a basic DIV I want to show including the tags. I want to grab the code from it's actual place and show it here, so just reqriting the tags is not a good option. Calling a function to do some basic replacements would be OK though. Even better would be to be able to use an HTML region that escapes the special characters, but it seem like the help region only uses a standard html region.

Similar Messages

  • Issue with escaping characters and php

    Greetings,
    We are working on a web page using php and Oracle. We have troubles dealing with the diferent escaping characters when inserting/retrieving data (magic quotes is on but adding the backslash doesn't help :( ).
    We would like to know the correct way of dealing with those characters ( ' " / /n ...).
    Thank you in advance,
    Sincerely,
    Oriol Nonell

    Do NOT use addslashes/stripslashes to escape your queries. I use this function to do the escaping:
    function escapeSQL($string, $wildcard=false)
    $result = str_replace("'","''",$string);
    if ($wildcard == true) $result = str_replace("%","%%",$result);
    return $result;
    It basically replaces ' with ''.
    If you set $wildcard to false, then '%' is considered to be an actual '%' (for 'like' expressions). If you set it to true, a % is escaped to %% too.

  • Web Logic 10.3 upgrade causes issues with escaped characters in JSP.

    We recently upgraded our application servers from Weblogic 9.2 to Weblogic 10.3 and we are having an issue with escaped characters in a JSP code. Here is an example of what we are seeing:
    var convertedBody1 = document.getElementById('body').value.replace(/\$FIRST_NAME\$/g, firstName);
    This code works in Weblogic 9.2. In Weblogic 10.3 we have to make the following changes:
    var convertedBody1 = document.getElementById('body').value.replace(/\$FIRST_NAME\$/g, firstName);
    Thanks, Tom

    Hi:
    I have resolved the issue with the following in the jspx page.
    Put an
    <jsp:scriptlet>
    response.setContentType(“text/html; charset=UTF-8”);
    </jsp:scriptlet>
    Inside the <f:view> on the jspx file.
    Please refer the link http://www.oracle.com/global/il/support/tip/nlss11061.html for more details. It is helpful.
    Thanks & Regards
    Sridhar Doki

  • How to enlarge the text or characters on web pages permanently

    I need to know how to enlarge the text or characters permanently. I have difficulty reading the characters of each new page. Every time I zoom in to enlarge characters, the new page automatically returns to small characters. Please help.
    Cheng Lin
    [email protected]

    Try one of these extensions:
    *Default FullZoom Level: https://addons.mozilla.org/en-US/firefox/addon/6965
    *NoSquint: https://addons.mozilla.org/en-US/firefox/addon/2592/
    **More NoSquint info: http://urandom.ca/nosquint/
    <br />
    '''Other issues needing your attention'''
    The information submitted with your question indicates that you have out of date plugins with known security and stability issues that should be updated. To see the plugins submitted with your question, click "More system details..." to the right of your original question post.
    *Adobe PDF Plug-In For Firefox and Netscape
    **New Adobe Reader X (version 10) with Protected Mode just released 2010-11-19
    **See: http://www.securityweek.com/adobe-releases-acrobat-reader-x-protected-mode
    *Shockwave Flash 10.0 r42
    *Next Generation Java Plug-in 1.6.0_22 for Mozilla browsers
    **No security issues corrected in version 1.6.0_23, but, according to Oracle/Java, some stability issues resolved.
    #'''Check your plugin versions''': http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**Use the links below to avoid getting the troublesome "getplus" Adobe Download Manager and other "extras" you may not want
    #**Use Firefox to download and SAVE the installer to your hard drive from the appropriate link below
    #**Click "Save to File"; save to your Desktop (so you can find it)
    #**After download completes, close Firefox
    #**Click the installer you just downloaded and allow the install to continue
    #***Note: Vista and Win7 users may need to right-click the installer and choose "Run as Administrator"
    #**'''<u>Download link</u>''': ftp://ftp.adobe.com/pub/adobe/reader/
    #***Choose your OS
    #***Choose the latest #.x version (example 9.x, for version 9)
    #***Choose the highest number version listed
    #****NOTE: 10.x is the new Adobe Reader X (Windows and Mac only as of this posting)
    #***Choose your language
    #***Download the file
    #***Windows: choose the .exe file; Mac: choose the .dmg file
    #*Using either of the links below will force you to install the "getPlus" Adobe Download Manager. Also be sure to uncheck the McAfee Scanner if you do not want the link forcibly installed on your desktop
    #**''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #**Also see: https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox (do not use the link on this page for downloading; you may get the troublesome "getplus" Adobe Download Manager (Adobe DLM) and other "extras")
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''. Note separate links for:
    #**Plugin for Firefox and most other browsers
    #**ActiveX for IE
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    #*Also see "Manual Update" in this article: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • How can I use escaped-characters in an option

    I have the following code that is used to retrieve city-names including parent-child relations from a database and place them in an array:
    <%@ page contentType="application/x-javascript" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <sql:setDataSource dataSource="jdbc/KADOS" var="Raak" scope="session" />
    <sql:query var="bewaringSQL" dataSource="${Raak}">
    SELECT bewaringcode, vestigingsplaats FROM BEWARING order by vestigingsplaats
    </sql:query>
    bewaringen = new Array(
    <c:forEach items="${bewaringSQL.rows}" var="plaats" varStatus="s" >
    new Array( "<c:out value="${plaats.BEWARINGCODE}" />",
    "<c:out value="${plaats.VESTIGINGSPLAATS}" />" )
    <c:if test="${not s.last}">,</c:if>
    </c:forEach>
    i=0;
    <c:forEach items="${bewaringSQL.rows}" var="plaats" varStatus="s" >
    <sql:query var="bewaringGemSQL" dataSource="${Raak}" sql="SELECT KADGEMCODE, KGMNAAM FROM KADGEMEENTE where BEWARINGCODE=? order by KGMNAAM">
    <sql:param value="${plaats.BEWARINGCODE}" />
    </sql:query>
    tmp = new Array(
    <c:forEach items="${bewaringGemSQL.rows}" var="gem" varStatus="s" >
    new Array( "<c:out value="${gem.KGMNAAM}" />",
    "<c:out value="${gem.KADGEMCODE}" />" )
    <c:if test="${not s.last}">,</c:if>
    </c:forEach>
    bewaringen[2] = tmp;
    i = i+1;
    </c:forEach>
    function bewaringenList(selectCtrl, itemArray) {
    for (i=0; i<itemArray.length; i++) {
    selectCtrl.options[i] = new Option(itemArray[i][1]);
    selectCtrl.options[i].value = itemArray[i][0];
    function setList(selectCtrl, itemArray) {
    for (i=selectCtrl.options.length; i>=0; i--) {
    selectCtrl.options[i] = null;
    for (i=0; i<itemArray.length; i++) {
    optie = filter(itemArray[i][0]);
    selectCtrl.options[i] = new Option(optie);
    selectCtrl.options[i].value = itemArray[i][1];
    function filter( invoer) {
    retour = invoer;
    retour = retour.replace("'", "\'");
    return retour;
    The function 'bewaringenList' populates a <SELECT> with parent-names and
    "setList(document.VraagForm.gemSelect, bewaringen[this.selectedIndex][2]);" populates the depending <SELECT> with child-names.
    Some names contain single quotes (like "&#039;t Zandt") and are displayd in the select-box as "&#039t Zandt".
    I expected that the quotes could be replaced by escape-characters by 'filter(invoer)' but this does not work.
    Is there a generic way to show these characters?
    Ben

    I don't understand why but this filter solved the problem:
    function filter( invoer) {
    retour = invoer;
    retour = retour.replace("&#039;", "'");
    return retour;

  • VLD-1141, Template cannot contain escape characters.

    Hi All,
    I need help about mapping deployment. I am working on a mapping. I can deploy it before to 9i target location. But after upgrading target database to 10g, I get the error VLD-1141 when I deploy it. The detail is Template cannot contain escape characters.
    And the full error message is as following:
    VLD-1141: Internal error during mapping generation.
    java.lang.IllegalArgumentException: Template cannot contain escape characters.
    at oracle.wh.util.expr.WBLiteralExpression.<init>(WBLiteralExpression.java:34)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.addContextExpressionsForGroups(GenericTransformGenerationDelegate.java:345)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.prepareOutputContextPlSql(GenericTransformGenerationDelegate.java:1433)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformPlSqlDelegate.prepareOutputContext(GenericTransformPlSqlDelegate.java:147)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:239)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoopInternal(PlSqlGenerationMediator.java:3206)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoop(PlSqlGenerationMediator.java:3190)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleRowBased(PlSqlGenerationMediator.java:3115)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assemble(PlSqlGenerationMediator.java:538)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:770)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:316)
    at oracle.wh.service.impl.mapping.generation.WBDeployableMappingGenerator.generate(WBDeployableMappingGenerator.java:99)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:433)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:311)
    at oracle.wh.service.impl.generation.service.WhValidationGenerationTransaction.run(WhValidationGenerationTransaction.java:241)

    There are to bugs:
    Bug 5403652 - ERROR 'TEMPLATE CANNOT CONTAIN ESCAPE CHARACTERS' WHEN VALIDATING A MAPPING
    Bug 5561224 - MIGRATION OF MAPPING REQUIRES CHANGE IN CONFIG TO ALLOW VALIDATION
    against OWB 10.2.0.1
    but these bugs are fixed from 10.2.0.2
    The bug is related to pre/post mapping operators...
    If you are on 10.2.0.3 or your mapping does not have these operators then have no clue...

  • Displaying unicode or HTML escaped characters from HTTPService in Flex components.

    Here is a solution on the Flex Cookbook I developed for
    displaying data in Flex components when the data comes back from
    HTTPService as unicode of HTML escaped data:
    Displaying
    unicode or HTML escaped characters from HTTPService in Flex
    components.

    Hi again Greg,
    I have just been adapting your idea for encountering
    occasional escaped characters within a body of "normal" text, eg
    something like
    hell&ocirc; sun&scaron;ine
    Now, the handy String.fromCharCode(charCode) call works a
    dream if instead of the above I have
    hell&#244; sun&#353;ine
    Do you know if there is an equivalent call that takes the
    named entities rather than the numeric ones? Clearly I can just do
    some text substitution to get the mapping, but this means rather
    more by-hand work than I had hoped. However, this is definitely a
    step in a useful direction for me.
    Thanks,
    Richard
    PS hoping that the web page won't simply outguess me and
    replace all the above! Basically, the first line uses named
    entities and the second the equivalent numbers...

  • Official documents on escaping characters in SQL Server query statements

    Hi,
    Are there any official documents on how to escaping special characters in SQL Server query statements? I find a lot of online resources discussing about this, but there are no definitive conclusions on:
    Which characters should be escaped? (Some only said single-quote needs to be escaped, double-quote does not need. While others said both need to be escaped)
    How to escape characters? (Some said using two single-quote to escape a single-quote. Others said using a backslash, etc.)
    So I just wonder if there is an official document from Microsoft regarding this?
    Thanks
    Alan

    Depends on where you're using them
    If its string values then single quotes(') should be escaped by putting one more single quote before it.
    If its LIKE operator you can use ESCAPE keyword or use [] to escapre special characters 
    see
    http://visakhm.blogspot.in/2013/01/wildcard-character-based-pattern-search.html
    If inside SSIS expression you can escape characters like \ " etc by adding an extra \ before the characters
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Validation - template cannot contain escape characters

    Hi all, im new to Warehouse builder, i find the documentation lacking, the tutorials lacking and i can't find any books on warehouse builder either. Am I stupid ? :-)
    Anyway, i've set up 3 constants (varchar2) to pass as parameter values to a function im calling and when i try to validate the mapping im getting 'Template cannot contain escape characters'.
    Then im getting validation completed successfully..however, when i try to deploy im getting this:
    VLD-1141: Internal error during mapping generation.
    java.lang.IllegalArgumentException: Template cannot contain escape characters.
    at oracle.wh.util.expr.WBLiteralExpression.<init>(WBLiteralExpression.java:34)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.addContextExpressionsForGroups(GenericTransformGenerationDelegate.java:345)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformGenerationDelegate.prepareOutputContextPlSql(GenericTransformGenerationDelegate.java:1433)
    at oracle.wh.service.impl.mapping.component.transforms.GenericTransformPlSqlDelegate.prepareOutputContext(GenericTransformPlSqlDelegate.java:147)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:239)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoopInternal(PlSqlGenerationMediator.java:3206)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleCursorLoop(PlSqlGenerationMediator.java:3190)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assembleRowBased(PlSqlGenerationMediator.java:3115)
    at oracle.wh.service.impl.mapping.generation.PlSqlGenerationMediator.assemble(PlSqlGenerationMediator.java:538)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:770)
    at oracle.wh.service.impl.mapping.generation.WBMappingGenerator.generate(WBMappingGenerator.java:316)
    at oracle.wh.service.impl.mapping.generation.WBDeployableMappingGenerator.generate(WBDeployableMappingGenerator.java:99)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:433)
    at oracle.wh.service.impl.generation.common.WBGenerationService.generateCode(WBGenerationService.java:311)
    at oracle.wh.service.impl.generation.service.WhValidationGenerationTransaction.run(WhValidationGenerationTransaction.java:241)
    I have no clue whatsoever what this is about, can anyone tell ?

    hi ,
    I also got the same error when i migrated MDL from owb 9.2 version.
    I was using OWB 10.2.01, and heard that it is a bug which is fixed in owb 10.2.0.3
    So i applied the patch and this error gone.
    In case if it help u.
    rojo

  • Creating Help pages

    I have designed a java program(GUI).
    There is a button that brings up a help page when clicked,
    like in microsoft word help.
    How do i create this help page.

    I have tested the html on a sample program.
    It's not what i'm working on.But it keeps giving 2 errors.
    error::invalid escape character at line 56
    error::invalid escape character at line 56
    N.B:The html file is stored on my hard disk
    Can someone tell me why?
    And i would appreciate any other suggestion to the problem i started
    with at the begining of this thread(posting 1-5).
    Here is the code:
    import java.awt.*;
    import java.awt.event.*;
    import com.sun.java.swing.*;
    //import com.sun.java.swing.text.*;
    import javax.swing.*;
    import java.net.URL;
    public class EeyoreQuotes extends JPanel {
        private Font demoFont = new Font("Serif", Font.PLAIN, 14);
        private boolean DEBUG = true;
        public EeyoreQuotes() {
         //create text field
         JTextField textField = new JTextField("Don't bustle me.", 15);
         textField.setFont(demoFont);
         //create password field
         JPasswordField passwordField = new JPasswordField("Don't now-then me.", 15);
         passwordField.setFont(demoFont);
         passwordField.setEchoChar('$');
         //create panel to contain text fields
         JPanel textFieldPane = new JPanel();
         textFieldPane.setLayout(new GridLayout(0, 1));
            textFieldPane.add(textField);
            textFieldPane.add(passwordField);
            textFieldPane.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder("Text Fields"),
                    BorderFactory.createEmptyBorder(0, 5, 5, 5)
         //create text area
         String text = "It's snowing still. \nAnd freezing. \n" +
                   "However, we haven't had \nan earthquake lately.";
         JTextArea textArea = new JTextArea(text);
         textArea.setEditable(false);
         textArea.setFont(demoFont);
         textArea.setMargin(new Insets(5,5,5,5));
         textArea.setPreferredSize(new Dimension(170,80));
         //create panel to contain text area
         JPanel textAreaPane = new JPanel();
         textAreaPane.add(textArea);
            textAreaPane.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createTitledBorder("Text Area"),
                    BorderFactory.createEmptyBorder(0, 5, 5, 5)
         //create html area
         JEditorPane quotePane = null;
         JScrollPane scrollPane = null;
            String s=null;
         try {
                s="C:/myjava/JEditorPane1.html";
             URL url = new URL(s);
             quotePane = new JEditorPane(url);
             quotePane.setEditable(false);
                scrollPane = new JScrollPane(quotePane);
             scrollPane.setPreferredSize(new Dimension(300, 175));
             if (DEBUG) {
                 System.out.println(quotePane.getText());
                 quotePane.setText(quotePane.getText());
         } catch (java.io.IOException e) {
                scrollPane = new JScrollPane(new JTextArea("Can't find HTML file."));
             scrollPane.setFont(demoFont);
         //create panel to contain html text
         JPanel htmlTextPane = new JPanel();
         htmlTextPane.add(scrollPane);
            htmlTextPane.setBorder(BorderFactory.createCompoundBorder(
                          BorderFactory.createTitledBorder("HTML Text"),
                          BorderFactory.createEmptyBorder(0, 5, 5, 5)
         GridBagLayout gridBag = new GridBagLayout();
         GridBagConstraints c = new GridBagConstraints();
         gridBag.setConstraints(textFieldPane, c);
         add(textFieldPane);
         c.gridwidth = GridBagConstraints.REMAINDER;
         gridBag.setConstraints(textAreaPane, c);
         add(textAreaPane);
         gridBag.setConstraints(htmlTextPane, c);
         add(htmlTextPane);
         setLayout(gridBag);
            setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
        public static void main(String[] args) {
         JFrame frame = new JFrame("Eeyore Quotes");
         frame.addWindowListener(new WindowAdapter() {
                 public void windowClosing(WindowEvent e) {
                  System.exit(0);
         frame.getContentPane().add("Center", new EeyoreQuotes());
         frame.pack();
        frame.setSize(200,200);
        frame.setVisible(true);
    }

  • Using devanagari script in the 'special characters' option in Pages

    Using the special characters menu in Pages how can I produce double consonances?  Any help would be gratefully received

    That should be double consonants if you have been searching.
    What keyboard are you using?
    Devanāgarī Typing & Keyboard Layouts (Mac & Windows)
    http://www.indiantypefoundry.com/help/technical-issues/devanagari-keyboard/
    https://discussions.apple.com/thread/3548952?start=0&tstart=0
    Peter

  • Weird Characters on Web Pages

    I am suddenly seing weird "symbol" or "dingbat" characters on web pages instead of letters, and this is happening on all browsers I try (firefox, safari, explorer). How do I fix this?

    Most likely it's a bad font or font cache. Helvetica Fractions and Times Phonetic are the most common. See this note:
    http://discussions.apple.com/thread.jspa?threadID=932561&tstart=0
    If that doesn't help, email a screen shot (tom at bluesky dot org).

  • Evaluation of escape characters

    I'm convinced there has got to be an easy way to do this, but I am too frustrated at this point to continue fighting it... I would much appreciate anyone's help.
    Let me use code to explain what I need help with.
    I have a String that contains the right hand side of a java String assignment. To simulate this:
    String rightHandSide = "\"line1\\nline2\\nline3\""so a println of rightHandSide LITERALLY displays:
    "line1\nline2\nline3"
    (notice the quotes and "escape characters" are are actually literal characters).
    I want to be able assign the evaluation/interpretation of this String to a String variable, such that:
    String escValue = workMagic(rightHandSide)is equivalent to:
    String escValue = "line1\nline2\nline3"Can anyone offer a simple solution to this problem? If the only solution involves writing my own parser, etc, I will just give up for now and work around this issue. However, it seems like there should be an easy way to do this?
    Thanks in advance for any and all help!

    Not too sure if this is what you wanted:
    workMagic.java
    ============
    public class workMagic {
       public static void main(String[] args) {
          String rightHandSide = "\"line1\\nline2\\nline3\"";
          String escValue = workMagic(rightHandSide);
          System.out.println(escValue);
       public static String workMagic(String in) {
          String out="";
          int k;
          int j=0;
          while (j<in.length()) {
             if (in.charAt(j)=='\\') {
                j++;
                if (j<in.length()) {
                   if (in.charAt(j)!='\\') out+="\\"+in.charAt(j);
                   else j--;
                } else out+='\\';
             } else if (in.charAt(j)!='\"') out+=in.charAt(j);
             j++;
          return out;
    }V.V.

  • Setting escape characters for a MySQL insertion

    Hello all. I'm trying to format an incoming string with escaped characters so I can insert them into a mysql database... a quick rundown would be
    ' replaced with \'
    " replaced with \"
    escaping newline characters with the literal text "\n" (without quotes)
    escaping arriage return characters with the literal text "\r" (without quotes)
    for some reason it's not working out. Here's the method I made to handle it:
      public static String mysqlEncode(String stringToEncode) {
        String returnString = stringToEncode;
        // Replace " with \"
        if (returnString.matches("\\\"")) returnString = returnString.replaceAll("\\\"", "\\\"");
        // Replace ' with \'
        if (returnString.matches("'")) returnString = returnString.replaceAll("'", "\\'");
        // Replace \ with \\
        if (returnString.matches("\\\\")) returnString = returnString.replaceAll("\\\\", "\\\\");
        // Replace newlines with \n
        if (returnString.matches("\\n")) returnString = returnString.replaceAll("\\n", "\\n");
        // Replace carriage returns with \r
        if (returnString.matches("\\r")) returnString = returnString.replaceAll("\\r", "\\r");
        return returnString;
      }and it keeps bombing out , I'm on my 3rd hour at this and it's really starting to irk me...
    questions:
    are my regular expressions formed correctly?
    is that if statement calling the .matches() method necessary?
    Thanks so much for your help.

    String sql = "SELECT * FROM MyTable WHERE author = ? AND text = ?";
    PreparedStatement pstm = connection.prepareStatement(sql);
    synchronized(pstm){  // if you're doing multithreading stuff (if single thread..you can ignore the synchronized
        pstm.clearParameters();
        pstm.setString(1, "Anne Rice");    //  1 = the first question mark in the String sql
        pstm.setString(2, "The Vampire Lestat's long fangs");
    ResultSet res = pstm.executeQuery();
    while (res.next()){
    }same thing for INSERT, UPDATE, etc..

  • Escape characters using Oracle JDBC

    We use Oracle JDBC driver to do some operations on an Oracle 9i database, and ran into some problems with escape characters. Basically we'd like to escape the _ and % characters.
    The following two example statements both work:
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' escape '\\' ");
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' {escape '\\' }");
    However, when we have multiple query terms and the "escape" clause doesn't immediately follows EACH "like" clause, we got errors saying the sql statement does not end properly. One such example is the following:
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' and creator = 'ABC' {escape '\\'} ");
    If we put an "escape" clause following each "like" clause, then it works.
    My question is, is there a smart way of letting JDBC knows that you want to use an escape character everywhere in the query? We often do very complicated dynamic queries, frequently with table joins and boolean logic and subqueries with tons of query terms. Trying to add the escape clause to each "like" clause is very painful. Any help is highly appreciated. Thanks!
    BL

    I'd use PreparedStatements, if you're not already. Let the JDBC driver escape things properly for you. That's what the setString() and setDate() methods are all about.

Maybe you are looking for

  • How can i transfer music(not purchased on my itunes account) from my iphone to my laptop?

    I have music on my iPhone 5s that was not purchased using itunes. Is there any way i can transfer those files onto my macbook pro?

  • 2 TB External Drive no Longer Recognized by iMac 27"

    I have a 2 TB external HD (actually two 1 TB drives housed together in a OQC Mercury Elite Case) that has been working flawlessly for about 10 months as my Time Machine backup to the iMac 27". I have it hooked via FW800. Yesterday I noticed that TM b

  • Need help with Adobe Premiere Elements 9 for the Windows XP PC

    Just got it today, so I could make my own video and audio files from pre-existing ones.  I first used a version of Adobe Premiere back in school in the '90s, and seemed to easily make them there, while not working on school work.  There was a row for

  • Broken Pipe error  when connecting to database

    Hi I have installed ODI and Oracle 10g database on my machine. But getting a Broken Pipe error while creating an entity in Oracle Data Profiling and Quality tool Or I can say while connecting database. It's a runtime error. Server terminated the appl

  • Printing to border

    Can anyone tell me how to print to the edge of an A4 page?  Am using InDesign CS4. We print a catalogue & have an illustration on the front which we want to bleed to the very left hand edge (landscape). The illustration is positioned at the edge of t