Character encoding with CF and MySQL

Okay, I thought this should be rather straight forward but
apparently not. I have set up my site to use UTF-8— my cfm
pages, the MySQL table, even Dreamweaver. The problem is when I
input international character via a form they get written correctly
to the MySQL table; however, when I retrieve them in a query and
display them on the page I get them displayed incorrectly.
On my input.cfm page I'll enter the string
"Téstïñg" in the textbox and submit it. If I look at
the record via the MySQL Browser it appears as it should. However
when I display it on my output.cfm page it shows the record as
"T�st��g" and will do so until I change the
meta tag to use charset=ISO-8859-1. Am I missing something or is
this how it is suppose to work?
My input.cfm page is set up with both the
<cfprocessingdirective suppresswhitespace="YES"
pageencoding="UTF-8">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
tags and a regular input formfield that writes to the MySQL
database.
The MySQL table is configured to use the utf8 char set and
utf8_unicode_ci collation.
And just to be safe I included
useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
in the connection string on the CF Admin datasource setup page.
I'm running CF 6.1, MySQL 4.1, the latest version of Apache
Server on a Win2K3 box. I was running the 3.0.16 MySQL JDBC driver
but I upgraded it to the 5.0.6 this morning thinking that may fix
my issue.

I'm still unsure why this works but I've found a solution. I
switched all my pages over to character set ISO-8859-1 with the
exception of my database table and it works. I get all the normal
range character along with the extended Unicode characters to write
to the database and output correctly. Unicode characters actually
write to the table as their HTML coded character.
If someone feels the need to enlighten me as to why this
works please feel free, I'm always willing to learn.

Similar Messages

  • Problem with BigInteger and MySql

    Hi !!
    I've a problem with BigInteger and MySql.
    I've a BigInteger object (suppose that value is 0.02270412445068359375).
    I must store that value in a database (MySql).
    The value of BigInteger object must be stored in a column of type Decimal.
    Stored value is 0.022704124450683594. Why ??
    My target is to store 0.02270412445068359375
    Can anyone help me?
    Thanks.

    Hi !!
    I've a problem with BigInteger and MySql.
    I've a BigInteger object (suppose that value is
    0.02270412445068359375).
    I must store that value in a database (MySql).
    The value of BigInteger object must be stored in a
    column of type Decimal.if this is the case I fear you are SOL. a decimal is the same size as a double but with a fixed max number of decimal places. if it isn't big enough then you have no real choice other than to VARCHAR it.
    Stored value is 0.022704124450683594. Why ??
    My target is to store 0.02270412445068359375
    Can anyone help me?
    Thanks.

  • The performance of management system with Java and MySQL

    Hi all,
    I want to develop one management application with Java and MySQL. However I am not sure which is a good way to design the system. The system has to deal with customers' data in the database.
    Should I create objects for every customers when application starts so that I do not need to access to the database often? Or
    Should I access to the database everytime the user want to deal with customer's data?
    Welcome for any suggestion.
    Thank you
    Pat

    Hi
    i i think u should go through MVC model or use connection pooling

  • Wrong character encoding from flash to mysql

    Hi, im experiencing problems with character encoding not
    functioning correctly when sending from flash to mysql. What i am
    doing is doing a contact form in flash which then sends the value
    to a php file which takes the values and inserts them into a table.
    As i'm using icelandic charecters i need the char encoding to be
    either latin1 or utf8 in mysql, or at least i think so. But it
    seems that flash or the php document isn't sending in the same
    format as i have selected in mysql because all special icelandic
    characters come scrambled in the mysql table. Firefox tells me
    tough that the html document containing the flash movie is using
    utf-8.

    I don't know anything about Icelandic characters, but Flash
    generally really likes UTF-8. So it should be sending that if that
    is what it is starting with.
    You aren't using any kind of useCodePage? That will mess it
    up.
    Are you sure that the input method is Icelandic?
    In the testing environment can you list variables (from the
    debug menu) and see if they look proper? If they do then Flash is
    readying them correctly and the problem must be coming in further
    down stream.

  • Character encoding with xsql

    I have a similar application running to the xsql document demo. However, when I am pulling the xml clob out of the database, the character set is incorrect and the xml is not parsed correctly.
    Instead of a "<" in the returned xml source, I get the following characters:
    & # 6 0 ;
    (No spaces in between them).
    I seem to have this problem regardless of what type of field I pull the data out of (varchar2, char).
    Whats going on here?
    null

    Thanks for all your help! I just have encountered one more problem blocking me from completing this.
    I use the following two xsql pages:
    <?xml version='1.0'?>
    <?xml:stylesheet type="text/xsl" href="doctorv3_IE5.xsl" ?>
    <xsql:include-xsql connection="demo" xmlns:xsql="urn:oracle-xsql"
    href="doc_detail.xsql?id={@id}"/>
    and
    <?xml version="1.0" encoding="Windows-1250" ?>
    <?xml-stylesheet type="text/xsl" href="clob.xsl" result-type="text/xml"?>
    <xsql:query connection="demo" rowset-element="" row-element="" max-rows="1"
    xmlns:xsql="urn:oracle-xsql">
    select /* x.xml_clob */ x.xml_clob DOC
    from user_xml x
    where x.ihc_user_id= {@id}
    </xsql:query>
    combined with the following two stylesheets
    doctorv3_ie5.xsl:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="*|/"><xsl:apply-templates/></xsl:template>
    <xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>
    <xsl:template match="/">
    <head>
    <title>Sample XSL Stylesheet for Doctor Viewing Data</title>
    </head>
    <body>
    <center>
    <table width="100%" height="5%" border="5" cellspacing="0">
    <tr>
    <td bgcolor="#000077"><font size="+5" color="#FFFF00"><b><center>CLINICARE Patient Data</center></b></font></td>
    </tr>
    </table>
    </center>
    <p>
    <br></br>
    </p>
    <center>
    <table width="90%" height="5%" border="5" cellspacing="0">
    <tr>
    <td colspan="2" bgcolor="#000077"><font size="+3" color="#FFFF00"><b><center>Demographic Data</center></b></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>Surname</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatName"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>First Name</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatFirstName"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" heigh45t="18" width="30%"><font size="+2" color="#FFFF00"><b>Gender</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatGenderCode"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" heigh45t="18" width="30%"><font size="+2" color="#FFFF00"><b>Date of Birth</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatBirthDtm"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" heigh45t="18" width="30%"><font size="+2" color="#FFFF00"><b>Personal Health Number</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatIDNum"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>Address</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatPrimAddress/PatPrimAddressStreet"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF 00"><b>Postal Code</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:apply-templates select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatPrimAddress/PatPrimAddressPost"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>City</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatPrimAddress/PatPrimAddressCity"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>Phone Number</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatPrimAddress/PatPrimPhoneNum"/></font></td>
    </tr>
    </table>
    </center>
    <p>
    <br></br>
    </p>
    <center>
    <table width="90%" height="5%" border="5" cellspacing="0">
    <tr>
    <td colspan="2" bgcolor="#000077"><font size="+3" color="#FFFF00"><b><center>Primary Care Physician</center></b></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>Surname</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:apply-templates select="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhysName"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>First Name</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:apply-templates select="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhysFirstName"/></font></td>
    </tr>
    <tr>
    <td bgcolor="#000077" height="18" width="30%"><font size="+2" color="#FFFF00"><b>Specialty</b></font></td>
    <td bgcolor="#FFFFFF" height="18"><font size="+2" color="#000077">
    <xsl:apply-templates select="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhys"/></font></td>
    </tr>
    </table>
    </center>
    <p>
    <br></br>
    </p>
    <center>
    <table width="90%" height="5%" border="5" cellspacing="0">
    <tr>
    <td bgcolor="#000077"><font size="+3" color="#FFFF00"><b><center>Patient History</center></b></font></td>
    </tr>
    </table>
    </center>
    <p>
    <br></br>
    </p>
    <xsl:for-each select="PatientSummary/HEALTHITEMS/PHYSICALEXAMS" order-by="HExamDate">
    <hr></hr>
    <p><font color="#000077" size="+1"><b>Notes Entry Date:</b><xsl:value-of select="HExamDate"/></font></p>
    <p><font color="#000077" size="+1"><b>Doctor's Name:</b><xsl:value-of select="HExamExaminerName"/></font></p>
    <p><font color="#000077" size="+1"><b>Doctor's Number:</b><xsl:value-of select="HExamExaminerNUM"/></font></p>
    <xsl:for-each select="HExamItem">
    <p><font color="#000077" size="+1"><b>Category Description:</b><xsl:value-of select="HExamItemIDName"/></font></p>
    <p><font color="#000077" size="+1"><b>Category Code:</b><xsl:value-of select="HExamItemIDCode"/></font></p>
    <p><font color="#000077" size="+1"><b>Notes Entry:</b></font></p>
    <xsl:for-each select="HExamText">
    <dd><font c olor="#000077" size="+1"><xsl:value-of/></font></dd>
    </xsl:for-each>
    </xsl:for-each>
    </xsl:for-each>
    <p>
    <br></br>
    </p>
    <center>
    <table width="90%" height="5%" border="5" cellspacing="0">
    <tr>
    <td bgcolor="#000077"><font size="+3" color="#FFFF00"><b><center>Lab Test History</center></b></font></td>
    </tr>
    </table>
    </center>
    <p>
    <br></br>
    </p>
    <xsl:for-each select="PatientSummary/HEALTHITEMS/TESTS/CLINICALTESTS" order-by="HExamDate">
    <hr></hr>
    <p><font color="#000077" size="+1"><b>Report Date:</b><xsl:value-of select="PHProbNum"/></font></p>
    <p><font color="#000077" size="+1"><b>Report Time:</b><xsl:value-of select="DXProcSpecTypeCode"/></font></p>
    <p><font color="#000077" size="+1"><b>Requisition #:</b><xsl:value-of select="DXOrdIDNum"/></font></p>
    <xsl:for-each select="DXClinLabTest">
    <p><font color="#000077" size="+1"><b>Test Name:</b><xsl:value-of select="DXClinLabTestName"/></font></p>
    <p><font color="#000077" size="+1"><b>Result Comments:</b></font></p>
    <xsl:for-each select="DXProcReportText">
    <dd><font color="#000077" size="+1"><xsl:value-of/></font></dd>
    </xsl:for-each>
    </xsl:for-each>
    <xsl:for-each select="DXProcNmeasAnalyte">
    <p><font color="#000077" size="+1"><b>Test Value:</b><xsl:value-of select="DXProcNmeasAnalValQty"/></font></p>
    <p><font color="#000077" size="+1"><b>Normality:</b><xsl:value-of select="DXProcNmeasAnalInterpCode"/></font></p>
    </xsl:for-each>
    </xsl:for-each>
    </body>
    </xsl:template>
    <xsl:template match="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhysName">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhysName"/>
    </xsl:template>
    <xsl:template match="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhysFirstName">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhysFirstName"/>
    </xsl:template>
    <xsl:template match="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhys">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PRIMECAREPHYSICIAN/PatPrimCarePhys"/>
    </xsl:template>
    <xsl:template match="/PatientSummary/ADMINISTRATIVE/PATIENT/PatPrimAddress/PatPrimAddressPost">
    <xsl:value-of select="/PatientSummary/ADMINISTRATIVE/PATIENT/PatPrimAddress/PatPrimAddressPost"/>
    </xsl:template>
    </xsl:stylesheet>
    and clob.xsl:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="DOC">
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:template>
    </xsl:stylesheet>
    If I remove the reference to the doctorv3_IE5 stylesheet, I recieve properly formatted xml code displayed in xml, thanks to the clob.xsl stylesheet. When I try to reference the stylesheet, however, the stylesheet doesn't format correctly - IE5 displays only the XSL stylesheet, not the XSL combined with the XML.
    Saving this xml code to a file and then combining it with the xsl works exactly like in should, but I cannot get the xsql page to combine the two properly.
    Any ideas on whats wrong?
    null

  • Seeing � etc despite having View--Character encoding as unicode and auto-detect universal

    On viewing some web pages see characters such as �, ,  (for example). But View-Character Encoding is set at Unicode (UTF-8) or Western (ISO8859-1) and Tools-Options-Content-Fonts-Advanced Encoding set with either of those

    example of page:
    http://scienceofdoom.com/2010/09/17/on-missing-the-point-by-chilingar-et-al-2008/
    - a little over half way down, the section headed "Anthropogenic Imact on the Earth’s Climate – Tiny" from paragraph "And continue: " there are these non-characters in the equation (12) and subsequently.
    Another page : http://www.zimbabwesituation.com/sep26_2010.html in the topic " Red warning lights" .
    Most web-pages I read are without problem.
    I contacted the writer of the first page and s/he had no idea why it happens.

  • Character encoding: Ansi, ascii, and mac, oh my!

    I'm writing a program which has to search & replace data in user-supplied Rich Text documents (.rtf). Ideally, I would like to read the whole thing into a StringBuffer, so that I can use all of the functionality built into String and StringBuffer, and so that I can easily compare with constant Strings and chars.
    The trouble that I have is with character encoding. According to the rtf spec, RTFs can be encoded in four different character encodings: "ansi", "mac", IBM PC code page 437, and IBM PC code page 850, none of which are supported by Java (see http://impulzus.sch.bme.hu/tom/szamitastechnika/file/rtfspec/rtfspec_6.htm#rtfspec_8 for the RTF spec and http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc for the character encodings supported by Java).
    I believe, from a bit of googling, that they are all 8 bits/character, so I could read everything into a byte array and manipulate that directly. However, that would be rather nasty. I would have to be careful with the changes that I make to the document, so that I do not insert values that do not encode correctly in the document's character encoding. Overall, a large hassle.
    So my question is - has anyone done something like this before? Any libraries that will make my job easier? Or am I missing something built into Java that will allow me to easily decode and reencode these documents?

    DrClap, thanks for the response.
    If I could map from the encodings listed above (which are given in the rtf doucment) to a java encoding name from the page that you listed, that would solve all my problems. However, there are a couple of problems:
    a) According to this page - http://orwell.ru/info/diffs.htm - ANSI is a superset of ISO-8859-1. That page isn't exactly authoritative, but I can't afford to lose data.
    b) I'm not sure what to do about the other character encodings. "mac" may correspond to "MacRoman" but that page lists a dozen or so other macintosh encodings. Gotta love crystal-clear MS documentation.

  • Connection issue on 32 bit Linux OBIEE with Postgres and Mysql

    I am having trouble running reports on 32 bit Linux OBIEE version 10.1.3.4.0 and 10.1.3.4.1 with Postgres or Mysql as data source . I can connect to same data source (postgres and Mysql) from presentation services on windows box and also run queries from nqcmd using 32 bit linux ODBC driver on linux box running OBIEE server. I turned on odbc trace and I see following failures from Postgres and Mysql.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 12010] Communication error connecting to remote end point: address = ; port = 9703. (HY000)
    SQL Issued: SELECT test_obiee.c1 saw_0 FROM test_Postgre30 ORDER BY saw_0
    Mysql odbc trace file :
    ppid=1:pid=2908 719a:f4c1fb90 ENTER SQLSetConnectOption
    HDBC 0x08d4f170
    UWORD 1042
    UDWORD 4079342863
    ppid=1:pid=2908 719a:f4c1fb90 EXIT SQLSetConnectOption with return code 0 (SQL_SUCCESS)
    HDBC 0x08d4f170
    UWORD 1042
    UDWORD 4079342863
    ppid=1:pid=2908 719a:f4c1fb90 ENTER SQLErrorW
    HENV 0x00000000
    HDBC 0x08d4f170
    HSTMT 0x00000000
    WCHAR * 0xf4c1e140 (NYI)
    SDWORD * 0xf4c1e1a8
    WCHAR * 0xf4c1dd40
    SWORD 1022
    SWORD * 0xf4c1e1ae
    ppid=1:pid=2908 719a:f4c1fb90 EXIT SQLErrorW with return code 100 (SQL_NO_DATA_FOUND)
    HENV 0x00000000
    HDBC 0x08d4f170
    HSTMT 0x00000000
    WCHAR * 0xf4c1e140 (NYI)
    SDWORD * 0xf4c1e1a8
    WCHAR * 0xf4c1dd40
    SWORD 1022
    SWORD * 0xf4c1e1ae
    ppid=1:pid=2908 719a:f4c1fb90 ENTER SQLFreeConnect
    HDBC 0x08d4f170
    ppid=1:pid=2908 719a:f4c1fb90 EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS)
    HDBC 0x08d4f170
    Postgres odbc trace file :
    ppid=1:pid=2951 734f:f4a56b90 ENTER SQLAllocConnect
    HENV 0x0a0cf8c8
    HDBC * 0x0a12f278
    ppid=1:pid=2951 734f:f4a56b90 EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS)
    HENV 0x0a0cf8c8
    HDBC * 0x0a12f278 ( 0x0a12f398)
    ppid=1:pid=2951 734f:f4a56b90 ENTER SQLSetConnectOption
    HDBC 0x0a12f398
    UWORD 110
    UDWORD 0
    ppid=1:pid=2951 734f:f4a56b90 EXIT SQLSetConnectOption with return code 0 (SQL_SUCCESS)
    HDBC 0x0a12f398
    UWORD 110
    UDWORD 0
    ppid=1:pid=2951 734f:f4a56b90 ENTER SQLSetConnectOption
    HDBC 0x0a12f398
    UWORD 108
    UDWORD 2
    ppid=1:pid=2951 734f:f4a56b90 EXIT SQLSetConnectOption with return code 0 (SQL_SUCCESS)
    HDBC 0x0a12f398
    UWORD 108
    UDWORD 2
    ppid=1:pid=2951 734f:f4a56b90 ENTER SQLDriverConnectW
    HDBC 0x0a12f398
    HWND 0x00000000
    WCHAR * 0xf31ad2c0 [      -3] "******"
    SWORD -3
    WCHAR * 0xf31ad2c0
    SWORD 6
    SWORD * 0xf4a4d9de
    UWORD 0 <SQL_DRIVER_NOPROMPT>
    I am new to OBIEE and would appreciate any help . I have verified that data source names used in administration matches ODBC DSN in odbc.ini.

    S Chatterji wrote:
    We are in the process of testing backup recovery for our database. We want to test point in time recovery using RMAN.
    Issue:
    Our production has (64 bit)
    Linux DbProd.xxx.dk 2.6.18-164.0.0.0.1.el5xen #1 SMP Thu Sep 3 00:34:43 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
    and our test area on VMware has (32 bit)
    Linux dbprod.xxx.dk 2.6.18-128.2.1.4.9.el5xen #1 SMP Thu Sep 3 00:34:43 EDT 2009 i686 i686 i386 GNU/Linux
    Please advice a best practice to achieve this.
    Thanks.
    S ChatterjiDuplicate posts do not increase your chances for an answer
    Database » Database - Upgrade, - Test recovery on 32 bit Linux where as Production is on 64 bit with Archive
    Database » Installation, - Test recovery on 32 bit Linux where as Production is on 64 bit with Archive

  • How to handle blob data with java and mysql and hibernate

    Dear all,
    I am using java 1.6 and mysql 5.5 and hibernate 3.0 . Some time i use blob data type . Earlier my project's data base was oracle 10g but now i am converting it to Mysql and now i am facing problem to save and fetch blob data to mysql database . Can anybody give me the source code for blob handling with java+Mysql+Hibernate
    now my code is :--
    ==================================================
    *.hbm.xml :--
    <property name="image" column="IMAGE" type="com.shrisure.server.usertype.BinaryBlobType" insert="true" update="true" lazy="false"/>
    ===================================================
    *.java :--
    package com.shrisure.server.usertype;
    import java.io.OutputStream;
    import java.io.Serializable;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Types;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.BLOB;
    import org.hibernate.HibernateException;
    import org.hibernate.usertype.UserType;
    import org.jboss.resource.adapter.jdbc.WrappedConnection;
    import com.google.gwt.user.client.rpc.IsSerializable;
    public class BinaryBlobType implements UserType, java.io.Serializable, IsSerializable {
    private static final long serialVersionUID = 1111222233331231L;
    public int[] sqlTypes() {
    return new int[] { Types.BLOB };
    public Class returnedClass() {
    return byte[].class;
    public boolean equals(Object x, Object y) {
    return (x == y) || (x != null && y != null && java.util.Arrays.equals((byte[]) x, (byte[]) y));
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    BLOB tempBlob = null;
    WrappedConnection wc = null;
    try {
    if (value != null) {
    Connection oracleConnection = st.getConnection();
    if (oracleConnection instanceof oracle.jdbc.driver.OracleConnection) {
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    if (oracleConnection instanceof org.jboss.resource.adapter.jdbc.WrappedConnection) {
    InitialContext ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("java:/DefaultDS");
    Connection dsConn = dataSource.getConnection();
    wc = (WrappedConnection) dsConn;
    // with getUnderlying connection method , cast it to Oracle
    // Connection
    oracleConnection = wc.getUnderlyingConnection();
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    tempBlob.open(BLOB.MODE_READWRITE);
    OutputStream tempBlobWriter = tempBlob.getBinaryOutputStream();// setBinaryStream(1);
    tempBlobWriter.write((byte[]) value);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    tempBlob.close();
    st.setBlob(index, tempBlob);
    } else {
    st.setBlob(index, BLOB.empty_lob());
    } catch (Exception exp) {
    if (tempBlob != null) {
    tempBlob.freeTemporary();
    exp.printStackTrace();
    st.setBlob(index, BLOB.empty_lob());
    // throw new RuntimeException();
    } finally {
    if (wc != null) {
    wc.close();
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
    final Blob blob = rs.getBlob(names[0]);
    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
    public Object deepCopy(Object value) {
    if (value == null)
    return null;
    byte[] bytes = (byte[]) value;
    byte[] result = new byte[bytes.length];
    System.arraycopy(bytes, 0, result, 0, bytes.length);
    return result;
    public boolean isMutable() {
    return true;
    public Object assemble(Serializable arg0, Object arg1) throws HibernateException {
    return assemble(arg0, arg1);
    public Serializable disassemble(Object arg0) throws HibernateException {
    return disassemble(arg0);
    public int hashCode(Object arg0) throws HibernateException {
    return hashCode();
    public Object replace(Object arg0, Object arg1, Object arg2) throws HibernateException {
    return replace(arg0, arg1, arg2);
    =================================================================
    can anyone give me the source code for this BinaryBlobType.java according to mysql blob handling ..

    Moderator action: crosspost deleted.

  • Dreamweaver CS5.5 Mobile Apps with PHP and MYSQL?

    Hello,
    I don't have Dreamweaver CS5.5 yet and I've been trying to search for information on this but I couldn't find any. I've been learning PHP and been developing with MYSQL with Dreamweaver CS5 but I wanted to know if I can use the same tags and everything if I would to build a Mobile App using the new Dreamweaver CS5.5 (http://tv.adobe.com/watch/cs-55-web-premium-feature-tour-/dreamweaver-cs-55-jquery-mobile- pages/). I overlooked at the video and it seems pretty easy building an app. So is PHP and MYSQL easily integratable? Are there any examples that I might be able to check out?
    Thanks!

    No. PHP is a server-side scripting language that requires a server (or server-like environment) to run.
    An iPhone (or Android) application does not allow for a "built-in" server (which is resource intensive and has scary security implications). You just can't build an application with PHP/MySQL for a mobile device. Instead you can build a web service that your HTML/JavaScript mobile application can then communicate with. This is the only supported way you can use PHP/MySQL in a mobile app. Again: the PHP/MySQL should reside on a server and your HTML/JS mobile app can then communicate with that web service. That's what instapaper and other applications do.
    Frankly, just make a web application that's mobile device friendly and you'll:
    1) Avoid all the messiness of the app stores
    2) Have greater control over what your web app can do (don't have to tow the Apple/Google line)
    3) Have a web app that can work across mulitple mobile devices as well as standard web browsers (i.e. more audience = more $).
    4) Future proof your application (pushing updates to your server and everyone using your web app is updated)
    Otherwise, read-up on Adobe AIR and what it supports and remember, the best apps are written natively for the platform (i.e. want to write an app for an iPhone? Learn Objective-C and use xCode on a Mac. Want to write an app for Motorola Xoom? Learn the Android SDK and use inteliJ).

  • Character Encoding for JSPs and HTML forms

    After having read loads of postings on character encoding problems I'm still puzzled about the following problem:
    I have an instance (A) of WL 8.1 SP3 on a WinXP machine and another instance (B) of WL 8.1 without any SP on a Win2K machine. The underlying Windows locale is english(US) in both cases.
    The same application deployed as a war file to these instances does not behave in the same way when it comes to displaying non-Latin1-characters like the Euro symbol: Whereas (A) shows and accepts these characters as request-parameters, (B) does not.
    Since the war file is the same (weblogic.xml, jsps and everything), the reason for this must either be the service-pack-level or some other configuration setting I overlooked.
    Any hints are appreciated!

    Try this:
    Prefrences -> Content -> Fonts & Color -> Advanced
    At the bottom, choose your Encoding.

  • Tora pkgbuild: oracle tool with postgresql and mysql support

    Tora is a tool for oracle databases with some support for postgresql and mysql.
    tora PKGBUILD
    pkgname=tora-alpha
    pkgver=1.3.14.1
    pkgrel=1
    pkgdesc="Qt toolkit originally for Oracle databases administration with some support for Postgresql and Mysql"
    url="http://www.globecom.net/tora/"
    depends=('qt')
    makedepends=('perl')
    conflicts=('tora')
    source=(http://dl.sourceforge.net/tora/${pkgname}-${pkgver}.tar.gz)
    md5sums=('5560b5104438e1b71bd89386d0fcdc00')
    build() {
    cd $startdir/src/tora-$pkgver
    ./configure --prefix=/usr
    --without-kde
    --without-oracle
    --without-rpath
    make || return 1
    make ROOT=$startdir/pkg install
    I'm posting this pkgbuild only for testing/research.
    Fist, it's alpha (aka devel) version but stable release does not want to easly compile on my machine and it's too old IMO.
    As you can see it can be built without the need for kde (good news for other WMs/DEs users).
    The funny thing is that I built it without support for... oracle :-) That's because it needs lots of oracle stuff installed and I don't have it. If someone has, he can build a static version of oracle support (if you do please post some info here if it works, etc.).
    The postgresql/mysql support depends on the qt package configuration. Current qt arch package does not inlcude postgresql/mysql plugin support. The next qt release will have mysql support at least (http://bugs.archlinux.org/index.php?do=details&id=1040, http://bugs.archlinux.org/index.php?do=details&id=1166) and I have made a feature reqest for postgresql http://bugs.archlinux.org/index.php?do=details&id=1244.
    I'm still not 100% sure if postgresql and mysql should/shouldn't be put in makedepends (according to the docs and mailinglists it's not needed). I'll check that again when new qt release will be available.
    In other words in such configuration and present qt version this application is pretty useless :-) (though it can be run). But I'm posting this pkgbuild for the others (if someone needs to test it or tries to build it, etc.). I'm sure tora will soon be more attractive especially for someone using oracle databases.

    This won't work using a newer oracle instant client version though, since the pathes won't be set correct.
    The Project TOra won't use automake, since the author refuses doing so.
    Probably it would be a larger patching work to get it working with instantclient_10_2 (the current release version from Oracle).
    Why so?
    It seems as if the include pathes for the oracle client won't be set correclty, since TOra seems to expect a full oracle product installation.
    The configure does not accept a --with-oracle-includes or --with-oracle-libs option any longer (in 1.3.21 it did). Therefore, TOra won't find in example oci.h, since it's not in any include directory known.
    Also, some other files are not in the path TOra expects them to be.
    Without the possibility of passing by configure options handling this, i guess it won't be possible to get this TOra version running with the current instantclient.
    // STi

  • Problems with PHP and MySQLi server behaviors

    Hi,
    I'm a graphic and Web-designer with some knowledge of PHP and MySQL and I've been using Dreaweaver since very early ages in creating dynamic web projects and use the Bindings and Server behaviors quite a lot. But recently PHP has deprecated MySQL_connect since 2012 and it seems Dreamweaver isnt suporting the alternative MYSQLi server behaviors which will be the future of accessing Databases in MySQL along side with other options. Without this feature Dreamweaver is not of any use to us web-designers, since there are many Free great Editing software out there... Is the Dreamweaver team solving this problem? Or are you really planning on dropping this software? I've been using CS5.5 for a while and was planning on updating but this is a key feature and without it its not worth the investment.
    Kind regards.
    Eddy

    heduino wrote:
    Hi,
    I'm a graphic and Web-designer with some knowledge of PHP and MySQL and I've been using Dreaweaver since very early ages in creating dynamic web projects and use the Bindings and Server behaviors quite a lot. But recently PHP has deprecated MySQL_connect since 2012 and it seems Dreamweaver isnt suporting the alternative MYSQLi server behaviors which will be the future of accessing Databases in MySQL along side with other options. Without this feature Dreamweaver is not of any use to us web-designers, since there are many Free great Editing software out there... Is the Dreamweaver team solving this problem? Or are you really planning on dropping this software? I've been using CS5.5 for a while and was planning on updating but this is a key feature and without it its not worth the investment.
    Kind regards.
    Eddy
    There are no plans that I know of to introduce a new set of mysqli server behaviours into DW from Adobe. They have left that to  thrid party developers to bring out extensions which replace them.
    What the server behaviours could do was very limiting anyway so I suspect any replacement mysqli behaviours would also be very limiting. I personally jumped into thre code and started to write my own mysqli connection files and query strings by watching a few simple tutorials on youtube - it isnt that difficult.
    Look for 'php academy' on youtube - they have about 9 simple to follow tutorials on getting started with mysqli.

  • How I set character encoding for everypage and alway?

    I use Thai window 874 open the page when I select some website it contain Thai then click open new tab it change to western windows 1252. It can not display Thai. I must set character encoding to Thai windows 874 everytime.

    Try this:
    Prefrences -> Content -> Fonts & Color -> Advanced
    At the bottom, choose your Encoding.

  • Character encoding in Drafts and Templates won't "stick"

    I've been using T'bird for many years, am using now Version 30.0 with Windows 8. Over the years I have wrestled extensively with character encodings, because I do a lot of messages in mixed English and Cyrillic. I have things set now so that my default encoding is Cyrillic (Windows 1251) and this works pretty well, EXCEPT!! that when I save a message in my Drafts folder (or any of its subfolders), or my Templates folder, two things happen:
    1. the Cyrillic goes to garbage (I can sometimes recover this by physically moving the message to the Inbox)
    2. I get a series of  and/or à characters, with and without spaces between.
    This is a major pain in the butt! If I catch it the first time around, and move the offending message to the Inbox and "Edit as new", I can usually rescue the cyrillic - but if I (for example) make some changes elsewhere in the message in English portions and save it again (without noticing the mess-up of the cyrillic), it's all lost and I've found no way to recover it.
    I've been reading this forum and I suspect that my problem lies in the "folder properties", and/or maybe that I have not set up a User-defined set of display properties. However, I'm afraid to just mess around with things (as I've done so much in the past) for fear of messing up messages that I've been keeping for a long time in the OTHER folders.
    Help please? I use Windows 7.

    Didn't understand from what starting point you want me to "select the mail account name", but closed and re-opened T'bird.
    Then I started to run your tests.
    To my HUGE AMAZEMENT!!! - everything seems to be working today!!
    This leaves me with a couple of old files that seem to have gotten trashed a long time ago and won't simply "revover" - but I did keep back-up copies of them elsewhere, and can now go about rebuilding them if necessary.
    Thank you for your help - whatever it is that I did, seems to have worked. After how many years?! If I have trouble in the future, I'll be back - but for right now, what a RELIEF!
    Best, Martha

Maybe you are looking for

  • Fix for FACEBOOK's Compression

    Hi! I've created a piece of vector-artwork in ILLUSTRATOR (CC), looks WoW! Once my .png uploaded to FACEBOOK, it has lots of artifacts and looks pretty bad, compared to my original file. I read several articles in order to fix the problem, but nothin

  • Release strategy for PO on Payment terms..

    Dear friends, Is it possible to have Release strategy for PO on Payment terms..... I checked in CEKKO, no field availble for payment terms. Is there any other way.......... Plz help Rgds, Navin

  • How can I make Premiere Pro handle Live Text Templates faster?

    Currently I have a an After Effects Project that is setup as a Text Template.  When I render out the "template" composition in AFX, it takes 8 seconds.  The same composition through Live Text in Premiere Pro takes 34 minutes.  This comp is 6 seconds,

  • Accessing Specific PDF page in a hyperlink within CHM

    I have built a CHM in RoboHelp 9 and am trying to make a hyperlink that will take the reader directly to an included PDF page number, that starts a section in this PDF of about 3 pages. WIN7 TCS3.5

  • CREMAS03 - Company Data Creation

    Hi All, I am trying to send vendor data in to R/3 4.6c using CREMAS03. When is send company information, i get the following error: "No company codes have been allocated to cross-system company code XXX". I am looking for a transaction which will hel