Format large string for mysql

I am reading a large txt file that contains sigle quotes and double quotes... I want to format the string and send it to a blob cell in mysql. I need to add an escaoe character before single quotes and double quotes. Any suggestions?

john joe wrote:
I am reading a large txt file that contains sigle quotes and double quotes... I want to format the string and send it to a blob cell in mysql. I need to add an escaoe character before single quotes and double quotes. Any suggestions?
Yes!  Use "Search and Replace String" with "replace all?" = True.  Replace "'" with "\'" and replace """ with "\"".
Cheers.
Message Edited by tbd on 02-12-2007 11:06 PM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

Similar Messages

  • Need JDBC driver string for MYSQL DB Resin server

    Please any body provide me the jdbc driver for MYSQL
    database for Resin server
    Thanks

    The driver and URL string are independent of server you deploy them on.
    Put that JDBC JAR in your Web app's WEB-INF/lib directory and it'll be in the CLASSPATH.
    Set up the pooled data source as appropriate for your server. That's the server-dependent part.
    %

  • Escaping characters in string for MySQL

               String explain = "this piece of text includes single quotes ' and plus signs + and other chars that MySQL doesn't like";
                Statement state_commit = DBCon.con.createStatement();
                String sqlString = "UPDATE velocity SET speedExplain = '" + explain + "' WHERE shipName = 'pelican';";
                state_commit.execute(sqlString);
                Is there a java class which will prepare the string so that MySQL has no problem with it? I have tried in vain to get one such one : EscapeProcesor to work.
    Much obliged for any help

    DrLaszloJamf wrote:
    Always, ALWAYS, use PreparedStatement:
    http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html
    Or don't:
    http://www.theregister.co.uk/2008/01/21/riaa_hacktivism/

  • Report Designer odbc connection string for data source using a parameter

    I am using stand alone report designer 3 for the present and have a question/problem regarding the odbc connection string for MySQL when setting up the data-source
    I need to be able to enter a parameter which is the database name i.e. BOE-201401 or say BOE-201312 etc  from a list of databases the user can choose from.
    at present the odbc connection string points to BOE-201402
    the connection string is at present  Dsn=Development Server for MYsql;description=MYSQL;server=ldndw01;database=BOE-201402;port=3306
    my parameter has the name BOE_DATABASE
    and in an expression it is  as such
    =Parameters!BOE_DATABASE.Value
    I want to point the datasource for the report to the parameter value before the user sees the report.

    Hi Leslie,
    Based on your description, we want to design a report with a dynamic DataSource connection string. There are the basic steps below for your reference:
    Create report with static database.
    Change data source to report parameter.
    Send new database connection string as a report parameter. 
    More detail information, please refer to the following blog: Dynamic Database in SSRS 2008.
    http://haseebmukhtar.wordpress.com/2011/11/09/dynamic-database-in-ssrs-2008/
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • To count number of occurances of a char in a very large string

    Hi All,
    I like to count the no of occurances of a char in a a very large string.
    for example
    char ch - 'c'
    string str - "practical example is always needed"
    c occured 2 times in the above string.
    Thanks,
    J.Kathir

    > string str - "practical example is always needed"
    Try to finish this:
            String str = "practical example is always needed";
            char search = 'c';
            int occurrence = 0;
            for(int i = 0; i < str.length(); i++) {
                // Use a method from the String-class to get a
                // char from a specific location in the String.
                // See: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
            System.out.println("Occerrence of char "+search+" in \""+str+"\" is: "+occurrence);

  • Format into string 16 bit signed integer

    Is there any format specifier string for "Format into string", whereas the result is an I16 string?
    My problem is when I use "%d" and the input string is 65535, the result string should be "-1".
    Solved!
    Go to Solution.

    Are you trying to get an integer out of an ASCII string (Scan from String) or turn an integer into a string (Format into String).  You title and question seem to contradict each other.
    Assuming you are trying to scan from string, it looks like you need to scan into a U16 and then use a conversion bullet to turn it into an I16.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Scan I16.png ‏11 KB

  • Problem with JDBC driver for mysql

    I have downloaded the Connector/J3.0 mysql-connector-java-3.0.7-stable.tar.gz from www.mysql.com/downloads/api-jdbc-stable.html web site and used gunzip and tar to extract the file. I have received the following error message:
    tar: directory checksum error
    Will this error cause some problem later on?
    Which directory should I put the driver into? Can I put it in any directory?
    Do I need to set the classpath for the driver? If yes, how can I set it?
    What is the connect string? Can you give a sample for me? I am using Solaris 5.8 and mysql is on the same machine.
    Thanks a lot,
    Lisa

    this is an example of a connect string for mysql that i used...
    public Connection CreateConnection () throws Exception
         Connection myConn = null;
         String driverName = "org.gjt.mm.mysql.Driver";
         String dbUrl = "jdbc:mysql://www.desres.com/jhazrd?user=jhazrd&password=????";
         Class.forName(driverName);
         myConn = DriverManager.getConnection (dbUrl);
    return myConn;
    }

  • Can anyone answer this question? What is used to format a string so that it falls into a certain Row/Column in excel? see text for indepth question.

    I'm attaching a file that may help. Just remember this is my FIRST attempt at using NI/FeildPoint so things that would be obvious to the normal users more than likely would slide right by me. So I'll try and explain what the text contains as to make my problem more clear. I'm using a FP-1000, FP-AI-100, and a FP-TB-10. i'm creating a application where I'm using the 8 channels from the FP-AI-100 to monitor a control system ,that we manufacture. The control system is in an environmental chamber. I use the FP-TB-10 to monitor the temperature while in the chamber. The control system is ran for 4 hours under varing enviromental conditions while I monitor vital system voltages with the FP-AI-100. Now the application that i'm building starts with the obvious FP CREATE.VI and so forth I have no problem communicating with the FP's, but the information that I'm monitioring needs to be placed into a file with Headers describing the information below it. Now I use a "WHILE LOOP.VI" to monitor the FP-AI-100 & FP-TB-10 for the 4 hour period. but before that I create and open a file where I use a "CONCATENATE STRINGS.VI" to enter the headers I need. I do this by CONSTANTS, CONTROLS, TABs, AND CARRIAGE RETURN being entered into the "CONCATENATE STRINGS.VI" in the order I want them to appear. I use ROW 1 to enter (OPERATOR:with a CONSTANT) an a (CONTROL so the operator may enter his name and be recorded into the file) using a TAB to seperate Columns and a CARRIAGE RETURNto drop down to ROW 2 for the next headers. I use header names and TABs to seperate the columns. This part works great. I end up with ROW 1 having the operator information then ROW 2 having the headers for all the channels I'm using to monitor the control system with in their own column. The trouble happens when I write to this file during the "WHILE LOOP". The information recorded for DATE:, TIME:, and Channel 0 of the FP-AI-100 end up right under their corresponding header on ROW 3, but the rest of the data ends up on ROW 4 in column 3 and goes down many rows with some of the data not being stored at all. It varies on how many rows are used starting at ROW 4 but hey always stay in column 3. I use the "FP READ.VI" outputing to a "ARRAY TO SPREADSHEET STRING.VI" outputing to a "CONCATENATE STRINGS.VI" for each channel within the "WHILE LOOP" then into the "WRITE.VI". I use the "CONCATENATE STRINGS.VI" to place my data OR atleast I thought you could do that some how I'm not quit doing something write either there is a sampling/timing issue or writing to file issue where things are being confused in the "WHILE LOOP" if someone know a better route to perform what I'm tring here I would be interested. Its not like I'm not giving it the old colledge try here but without proper training and the vagness of the manuals it's difficult to understand what every connection actually does.I'm tring though for everyone who happens to fill pity for me
    Thanks for your help
    John Morris
    Glendinning Marine Product, Inc.
    Attachments:
    ALLchannels ‏273 KB

    > I appreciate your effort to help me, but there is still a slight cloud
    > in front of my eyes here.(I must mention that I'm using Labview 5.1
    Oh, to bad. I'm using LV 6,02 and tried to save the application as LV5.1,
    but it didn't work.
    > Lets start with the easy one which is the SECOND main thing you
    > wanted to mention. In my application I used individual Create Tag.vi's
    > "so your saying that I can use just one Create Tag.vi and one Read.vi
    > and what ever I use to display the values will automatically to show
    > the individual channels" in other words if I use a "Indicator(DBL)"
    > comming out of the Read.vi what ever I use in the "PANEL" layout will
    > expand to show all 8 channel if I was using a FP-AI-100? Cool...
    Allmost right. The 8 channels come out as 1D-array, ch0...ch7.
    > #1--How do I change the delimiter (TAB) to a delimiter (comma) in a
    > Array to Spreadsheet String.vi?
    > ...cut
    I don't use this Spreadsheet VI, because files coming out there allways
    start this time consuming EXCEL wizzard. Because of this, I programmed my
    own CSV-conversion vi. Maybe you could just use a common texteditor, like
    wordpad and put the csv-examples from my last reply down to a text file
    and rename it to *.csv. Texteditors terminate lines with "\r\n" by
    default, so this is a very quick way for testing.
    > FP_Analog_Logging example to record all eight channels it uses a Array
    I didn't find the vi you metione above, but there is another good one:
    Look at examples\FieldPoint\DataLogging\FP Logger.vi.
    In a little case structure, at "false", there is a function called "Format
    into string".
    Pop up on the format string and adjust >>'\' Codes Display<<.
    Then you change the format string into: %.;%-f%s
    A Tab string is connected to the lower input of this function. Replace
    this one with a comma.
    That should do.
    >
    > #2--If using just one Create Tag.vi and one Read.vi and I have the
    > Item Name listed as ALL I take it that the information comming out of
    > the Read.vi is data for each channel in a String format starting with
    > channel 0 and ending with channel 7 for the FP-AI-100.
    Yes, just as explained above. If you put a indicator at the output to
    display the values, you can expand the display to show all 8 channels, but
    you can't name induvidual cells. In a array, all cells have identical
    named labels. If you want to name the individually, you have to attach the
    array to cluster function and put the indicator after this one. Enable
    labe display and name the output values individually.
    > #3--Now I use the following to "Format String" in the Array to
    > Spreadsheet string.vi (%.4f)but I don't see anyway of changing the
    > delimiter from (TAB) to (COMA)
    Explained above.
    > #4 you stated text strings need a "as prefix and sufix" and each
    > string is seperated by a coma, a period is used as decimal number
    > separator and lines have to be terminated by my question is
    > WHERE IS THIS ACCOMPLISHED? WHAT VI OR WHAT CONNECTOR PIN?
    Well, modifying strings are done with string functions.
    Above, as I explained how the sample FP Logger.vi can be modified to do
    the job for numbers. The pre- and suffixing with ", you only need for
    strings, which EXCEL should interpret a string and as nothing else as a
    string, even if there's a number inside. You usually need this only for
    headers. So its easyest, if you just write your string into a string
    constant or control and concatenate it to the previous csv-file contents.
    Oh, I just see by looking at the above mentioned example... Inside the
    case structure, but in the "true" case, there are error messages
    concatenated to the logfile. At this point it is importent, to use " for
    integrating the message into the CSV file, because a error message usually
    looks like this: >> ERROR 2345 in vi yxz <<
    Here you have text and number strings mixed in one line. EXCEL does not
    know, if it should interpret the number inside the error line as separate
    number, separating the line into three colums i.e. string before number,
    number and string after number. So tell EXCEL by putting a " before and
    after the line each.
    For this, expand the Format To String function by one input, move down all
    connections, to be able to insert a string constant with a " to the first
    argument connector. Change the contents of the string constant at the
    bottom argument from tab to ", (quotation mark AND comma)
    > #5 You gave me an example of what a 3 column header could look like:
    > "col0","col1","col2"\r\n Now is this something that you enter
    > somewhere cause I know that \r is carriage return and \n is newline so
    > I take it that the above is entered somewhere maybe in the Write.vi to
    > the connector called Header (F)? See this is what confuses me because
    > NI manuals have no examples of certain connectors types being used or
    > any reference as to how they manipluate data with there varing type
    > inputs. Or maybe I'm just missing them.
    The example I mentioned above help here to.
    Look at the Write File function. This function receves data from a
    function named concatenate strings. Expand this function to have one more
    spare input at the bottom. Create a string constant. Switch the constant
    display to "\" mode. Enter "col0","col1","col2"\r\n into the constant.
    Connect the constant to the spare input.
    Doing this, every dataline in the csv file is followed by
    "col0","col1","col2"\r\n .
    I wish you a nice weekend,
    Rainer Ehrt

  • Java.util.Formatter format string for week of year?

    What is strange in the Formatter API, regarding dates, is that there is no format string to display week of year. To display day of year e.g. you can use:
    String.format(�%tj�),Calendar.getInstance())but what is the string for week of year?
    String.format(�%tw�),Calendar.getInstance())doesn�t work.
    Any ideas, or did I overlooked the API?

    I �m using
    String.format(�%tx�),Calendar.getInstance())everywhere in my code where x is any of the other (e.g. j, d etc.). Why use different way for this? How come Sun did�t add e.g. a w in the API to display the week of year as it does for day of year?

  • Match the string for a particular format

    i want to chek the string for a particular format..
    lets say for ex ,
    i have to check the string for 6A1N format where A - Alphabets and N - Numbers.
    that means my string exactly contains 6 alphabets from a to z and one number from 0 to 9
    like this i want to check for two more fromats..they are..
    2A7N1A or
    9N1A

    koneru9999 wrote:
    will the pattern is helpful in my case?
    and i don't have any idea doesn't mean finsh reading all the API right?You need to study http://www.regular-expressions.info/ and then http://java.sun.com/docs/books/tutorial/essential/regex/ .

  • EBS search string for check number

    Hello Gurus
    My client is using MT940 FORMAT for EBS,requirement is in a bank statement we are having 10 transactions which are having the same amount for ex:rs.1000 for ten payment transactions. now system is not able to post the document when we import the bank statement.
    I wanted to use search string for check number,  note to payee in bank statement is check number.Please find the below refference
    /EI/400229001       010013
    0000010013
    Reference 010013
    How could i use search string for this i tried but im not getting the solution im getting the following error difference is too large F5 263.
    Appreciated for our help............
    Thanks a lot in advance...............

    Hi Paulo,
    Thanks for the reply. However i have the following setting and it still does not work..
    Mapping -> AB01
    When i do the simulation it shows the Number and the hits and mapping.
    In the Seach String use i have following settings:
    CC 1000
    Interpretation : ALL Interpretation
    Search String : TEST1 ( this is the name that i gave to above search string)
    Target : Posting RUle
    Active checked.
    But still when i upload the bank statement it is posting to Rule AB03 and not AB01
    Also when i try FEBSTS it says no document hits ???
    Your answer is greatly appreciated.

  • Modifying a large string

    I have a For Loop that reads and modifies a 40 meg file. The file is a log of GPS and CAN messages. The Labview App will modify the data of one certain message type. This all works but it takes 4 and a half minutes to complete. Is there a faster way to do this other than creating a DLL? Is it due to Labview creating a new string every time the string's modified with the Replace Substring Function?
    Thank You
    Attachments:
    Labview VIs.zip ‏42 KB

    Ah, I see what you are trying to do now.  You are taking the read distance, recomputing the distance, and replacing the same data in the file.
    One of your biggest issues is that you are forking your wires a lot.  And that is a potential data copy.  And if you are copying large data, that takes a long time.  Instead, you should be trying to do as much in series as possible.  I changed your subVIs to use Scan From String and Format Into String instead of trying to increment value to read and convert to number multiple times.  This also allows you to build up the string to replace and do a single replacement.
    It might be worth trying Raven's suggestion of reading a single line at a time.  You might also want to look into the Producer/Consumer architecture to put the writing to the new file in parallel with your processing of the file.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    DistanceFix.zip ‏19 KB

  • Problem with retriving string from mysql DB

    hi,
    i am storing kannada (india) string into mysql database, that column is
    utf8_general_ci . when saw in db it showing ??????.
    while retriving it also printing ?????.
    what do with this problme, please help to solve this problem..
    thanks
    daya

    hi,
    i am storing kannada (india) string into mysql
    database, that column is
    utf8_general_ci . when saw in db it showing ??????.
    while retriving it also printing ?????.
    what do with this problme, please help to solve this
    problem..
    thanks
    daya
    hi,
    i am storing kannada (india) string into mysql
    database, that column is
    utf8_general_ci . when saw in db it showing ??????.
    while retriving it also printing ?????.
    what do with this problme, please help to solve this
    problem..
    thanks
    dayayou should store the text (kannada-writing) not within a normal CHAR or VARCHAR field in the MySQL-Database. instead store it in a BLOB-field and then retrieve the String by String out=new String (rs.getBytes()); (the BLOB field is used like a Stream so make the appropriate preparations and it should work!
    if not you can alter the above new String to new String(rs.getBytes(),"string-format"); where string-format is the iso-name for your language for instance for western europe "ISO-8859-1"

  • Help needed for MySQL 5 database DSN less connection with Oracle reports

    Hi,
    I am using Oracle Develper Suite and java (J2EE) for my application. I am using MySql 5 as database tool. I want to use Oracle reports of Oracle Develper suite. I have created some reports by first creating system DSN for MySql database and then connect Oracle reports to that DSN by "jdbc:odbc" connection string provided in Oracle Report developer wizard. This is working fine.
    I want to generate reports without creating system DSN (DSN less) so that i can use my application on any computer without creating DSN for Oracle Reports. I am deploying my application on OC4j as "EAR" file.
    Help in this regard will be highly appreciated.
    Regards.

    Using an 8i client, you will need to configure the tnsnames.ora file with appropriate connection information if you are using local naming. If you are using host naming or something like an Oracle Names server to resolve TNS aliases, you can skip the tnsnames.ora configuration. A default installation of the Oracle client, though, will probably be using local naming.
    If the tnsnames.ora file is configured, or you have configured an alternate way of resolving TNS aliases, you should be able to use the connection string
    DRIVER={Oracle ODBC Driver};DBQ=<<TNS alias>>;UID=system;PWD=managerIf you wanted to move to the 10g client (the 10g Instant Client could be useful here), there are some streamlined naming methods that could be used instead of configuring the tnsnames.ora file.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Need help on breaking a large string into substringsto fit in a line

    hii,suppose i have i have large string (the content of which is not apparently visible to me)which i want to show in a text area ,,,now how can i break it into multiple lines to be able view the total string...
    i dont want to use horizantal scrollbar...
    here i submit a sample code..and pls show me the neccesary modifications...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class textarea extends JFrame
    textarea()
    super("Text area length test");
    setSize(640,480);
    Container contentpane=getContentPane();
    JTextArea area=new JTextArea("Split panes allow the user to dynamically change the size of two or more components displayed side-by-side (within a window or another panel). Special dividers can be dragged with the mouse to increase space for one component and decrease the display space for another. Note that the total display area does not change. This gives applications a more modern and sophisticated view. A familiar example is the combination of a tree and a table separated by a horizontal divider (e.g. file explorer-like applications). The Swing framework for split panes consists only of JSplitPane.");
    area.setLayout(new BorderLayout());
    contentpane.add(area);
    setVisible(true);
    class texttest
    public static void main(String args[])
    new textarea();
    In the original code the Stron to be printed is not visible to me...

    Configure the text area so that it uses word wrap (see the javadoc)
    Kaj

Maybe you are looking for

  • Payment Program - Query

    Hi, We have a system in legacy where we have the policy of signing of cheques based on authority i.e. a cheque of say upto 25000 can be signed by M1 grade, 25001 - 100000 by M2 grade & so on. How can i replicate the same concept in SAP. Requirement:

  • Is it possible to identify and migrate a single app from iMac to MacBookPro instead of all the applications?

    In the migration of apps from my iMac to MacBookPro, one app did not migrate. Is there a way to redo the migration process but identify a single app and not the entire applications folder?

  • CS02 BDC

    Hello All, I created a BDC program for the CS02 Transaction. But the problem is : 1. I went to the Transaction CS02 directly. 2.Entered the parameter values for : Material, Plant, BOM Usage, Alternative BOM, Change Number Date 3. Pressed Enter 4. the

  • MacBook not booting after RAM upgrade

    I'm sorry if the case has been already posted. Yesterday I took my MacBook Alu unibody late 2008 to a RAM upgrade (from 2 to 4gigs) to an offical Mac Reseller. They installed it and showed me that the system loads properly and recognized the new RAM.

  • Header billing plan

    hi i am doing a code fro an user exit !! in that by the help of the value in rv45a-kfrel i am checking whether the header billing plan is checked or the item billing plan is checked!! but the problem is that for transactions va21 and va22 the value i