Corrupted Chinese characters shown while connecting to Sybase

SQL Developer experts,
While I connect to Sybase DB 11 via SQL developer 2.1.1 with 'jtds-1.2.5' JDBC driver, but I see corrupted Chinese characters from SQL developer, the Sybase DB is using 'iso_1' charset. Can anyone advise me how to solve the problem ? Any configuratioin should I do for the JDBC connection string and where to configure it ? Thanks in advance.

Hi,
When you browse your Sybase connection do you see the corrupt characters in the table name, column name the data or both.
Is the corrupt character a ? or an upsidedown ?
You say that you are using 'iso_1' charset in Sybase. Is this not just for western european languages ? in which case I wouldnt expect it to manage chinese characters.
When you log your Sybase instance using Sybase Central, do you see the correct characters?
Just to note I can browse I chinese (GBK) Sybase database where the tablenames, columnnames and data are in chinese.
Also that we currently only support jtds-1.2.jar .
Regards,
Dermot
SQL Developer Team

Similar Messages

  • Chinese characters shown not properly

    It was noted that some software couldn't show Chinese characters properly after upgrading to Lion. These characters were supposed to be shown in the same level, but they didn't. Even after upgrading to Mountain Lion, this problem remains.
    For example, Google Earth was one of such softwares. The following link is screenshot file download link.
    http://d.pr/f/bXPj
    Any suggestions about fixing this problem?

    Good point! Thanks!
    I just contacted with customer service of e麥客, whose software have the same situation. According to service personnel, they have noticed this problem and worked on it. It is estimated that the software update will be provided in coming October.
    As to Google Earth... I have to think about how to describe the situation in my broken English...
    Thanks again!

  • Chinese characters in PDF download

    Hi all,
    I have a problem while downloading PO into PDF file for e-mail send with chinese characters. In print preview, i can able to view the chinese characters. While downloading, these characters are replaced by square boxes. I am using the standard function module OPEN_FORM with nacha = 5.
    Please share if you have any solutions. I already implemented the OSS Note '1002451' & 1095211, but still the same.
    Regards,
    Sumathi.

    Hi,
    I have also faced the same problem, I was creating the PDF from SF, at the time of preview and print itu2019s absolutely fine,
    But When I was converting to Chinese the characters gets changed to some boxes. Can anyone know the solution please suggest.
    Regards,
    KD

  • Considering upgrading from CF8 up to CF11... notice in the CF11 support matrix that Sybase Adaptive Server Enterprise 15.0, 15.5  is not supported.  While we primarily connect to Oracle DB, we do need to connect to Sybase DBs periodically. Is the plan to

    Considering upgrading from CF8 up to CF11... notice in the CF11 support matrix that Sybase Adaptive Server Enterprise 15.0, 15.5  is not supported.  While we primarily connect to Oracle DB, we do need to connect to Sybase DBs periodically.
    Is the plan for CF11 to support Sybase again in the near future?

    Did you ever get a response? I'm merely trying to connect to a Sybase database - and it gives me a java.sql.SQLException:null  error - with no other information.
    I'm running the server on Ubuntu 14.x, 64bit.
    Thanks.

  • Chinese characters not shown correctly

    Hi there,
    I am having a problem with Chinese characters being correctly copied from a Word document into a Premiere Pro CS5 title. I am working with a Master Collection CS5 64-Bit on Windows 7.
    This is how the Chinese text  looks like in the Word document. Btw, the characters are correctly shown when being copied into Photoshop64bit. Just not when copied into my Premiere Pro title. So I guess my system has all the necessary tools available.
    操作1 – 预换模
    And this is how the text looks in my Premiere Pro title. Just that the two cubes are empty, only with the border.
    操作1 – 模
    I couldn't find information on that in the help area.
    No matter what the Chinese means, I don't speak Chinese.
    Does anyone could give me a hint how to solve the problem? First choice recommendations warmly welcome :-) Only second choice would be creating a picture file and putting it in a videolayer. No good solution with many titles.
    Thank you!
    Oliver

    Oliver,
    The Titler is about the most font-sensitive program (or sub-program), that Adobe produces. It is more sensitive, than say Photoshop, Illustrator or InDesign, and those three programs are much more font-sensitive, than say a word processing program, like Word. It also needs for fonts to be 100% compatible, and not all are. Some will just not display in Titler, where they might in other programs.
    The first thing that I would look into is the exact Chinese font that you have. If there is not a perfect, compatible free font, that is very, very similar, then I would look into one of the larger foundries, and buy something that is very close.
    Another fix could be to just use Photoshop (you say that it handles the font properly), and create your Title there. Save that Image as a PSD, and Import that Still Image into PrPro to be used as a Title. With complex Titles, I often use a combo of PS and AI, and Save my creation as a PSD. PrPRo loves PSD's, and I have never had an issue.
    As a side-note on fonts, I have found quite a few, and many are popular ones, that just flat will not display in PS, AI, InDesign or Titler - many versions of Isabelle and Isabella (do not know why two fonts with such similar names would both be problematic?), just will not display. One gets strings of squares, where most other programs handle and display them perfectly. It's all about the exact font.
    Good luck,
    Hunt

  • Blank spaces while using GUI_DOWNLOAD for Chinese characters

    Hi,
    While using GUI_DOWNLOAD for chinese characters I have used a code page option of 8300 for Chinese.
    The file which is getting downloaded in a notepad has some Chinese characters coming under some headings.
    After that columns other columns are getting shifted towards the right.
    This is working correctly for English characters.
    Can someone please help me.
    Now I am using CL_GUI_FRONT_END_SERVICES=>GUI_DOWNLOAD.
    What special options should I pass now.
    Regards,
    Subhashini

    Hi,
    I only solved my problem by using different code pages 8400 and 8300 for Chinese and Taiwanese characters.
    I fixed the lengths of the fields by converting them to hexadecimal string and back to string using these function modules as below.
    DATA:lv_xstring TYPE xstring,
           lv_temp TYPE string.
      DATA: lv_conv TYPE REF TO cl_abap_conv_in_ce.
      lv_temp = p_name.
      CALL FUNCTION 'HR_KR_STRING_TO_XSTRING'
        EXPORTING
          codepage_to      = p_codepage
          unicode_string   = lv_temp
          out_len          = p_outlen
        IMPORTING
          xstring_stream   = lv_xstring
        EXCEPTIONS
          invalid_codepage = 1
          invalid_string   = 2
          OTHERS           = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
       EXPORTING
         from_codepage = p_codepage
         in_xstring    = lv_xstring
         out_len       = p_outlen
       IMPORTING
         out_string    = p_string.
    Create a Conversion Instance
    lv_conv = cl_abap_conv_in_ce=>create(
    encoding = p_codepage
    input = lv_xstring ).
    v_conv->read( IMPORTING data = p_string ).
    Regards,
    Subhashini

  • How to configure my Firefox thus allowing me to input Chinese characters into the search box by using PenPower writing pad while this problem doesn't exist when I am using Internet Explorer?

    I am using the electronic writing pad made by PENPOWER Inc. to input Chinese characters onto my PC programs (e.g. Winword, Internet Explorer, Excel, etc.) But I can not make it happened on Firefox, please advice what I have to do with the configuration of the Firefox or using any other method to make it work. Thanking you guys in advance for helping me to solve this problem.

    cor-el,
    Thank you very much for your advice. The new software of Penpower works rightaway after I installed it on my pc. Thanks again.
    十分感激你的幫忙!

  • Problem with chinese characters while sending mail with .CSV attachment

    Hi,
    i am sendin .CSV file as an attachment with mail using "SO_DOCUMENT_SEND_API1" FM,
    whle opening the mail attachment the chinese characters are not displaying properly.
    currently i am using ECC 5.0
    can any body help in this regard.
    Thanks,
    Rahim

    Hi Kang Ring,
    please convert the content of the attachement into the binary format and then add it as a mail attachment.
    LOOP AT i_data ASSIGNING <wa_data>.
    if s_output is INITIAL.
    CONCATENATE <wa_data> cl_abap_char_utilities=>cr_lf into s_output.
    else.
    CONCATENATE s_output <wa_data> INTO s_output SEPARATED BY cl_abap_char_utilities=>cr_lf.
    endif.
    ENDLOOP.
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = s_output
    IMPORTING
    buffer = x_output.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    buffer = x_output
    TABLES
    binary_tab = imail_att.
         OR
    please use ABAP-Object classes like CL_BCS , CL_document_BCS.....
    please findthe below sample code.
      cl_bcs_convert=>string_to_solix(
              EXPORTING
                iv_string   = s_output
                iv_codepage = '4103'          "suitable for MS Excel, leave empty
                iv_add_bom  = 'X'               "for other doc types
              IMPORTING
                et_solix  = s_output_binary  "(of type solix_tab)
                ev_size   = size ).
    attachment->add_attachment(                       "attachment of type ref to cl_document_bcs
              i_attachment_type    = 'xls'                     
              i_attachment_subject = l_subject    
              i_attachment_size    = size
              i_att_content_hex    = s_output_binary ).
    you need to write the code for adding the receipents, subject and adding this "attachment " as an attachment to the mail.
    Hope this will helps to you....,
    thanks,
    Rahim.

  • Why a " # " is coming while printing chinese characters from SAP script?

    Hi All,
    Facing one issue.
    We have a SAP script for printing delivery note thru T-code VL03N. The script has chinese characters in it.
    When I print this form the chinese characters that are hardcoded in the script can be seen in the print out but the ones which are coming from the table cannot be seen instead they are repalced by " # ".
    Strangely, when a debug the script or see a print preview on the screen they can be seen as it is with no problem.
    Only when I print it, on the paper print they are seen as # but the characters that are hardcoded in the script can be seen clearly on paper.
    Secondly, in Transaction FB03 which is for display of list of documents it too has some chinese characters and when I print this directly from the t-code doing Shift-F1 ( no SAP script or form is involved in this case) then the same case is there the chinese characters get replaced by a " # ".
    Any inputs or views are welcome.
    Please suggest.
    Thanks.
    Cordially,
    Saurabh.

    Hi,
    You need to set your activate multibyte functions to support.
    Long on to SAP --->right side right corner (Customized local layout) --> click --->Select options --->select tab (l18N)
    -->Check Activate multibyefunctions to support.
    log off you SAP Gui then re-log in...you can able to view multi language characters.
    Thanks,
    Nelson

  • Issue with Chinese characters while sending IDOCs from PI to SAP system

    Hi,
    We are working on File to IDOC scenario where in some of the fields are having Chinese characters. In SAP system, we noticed that the Chinese characters are getting replaced with # where as in PI output payload we are able to see the correct Chinese characters. The systems involved are PI 7.4 and SAP ECC -6.0.

    Like in dual stack where we have an option to choose unicode/ non-unicode, i don't see any option in single stack.
    However not sure if it works but you can give a try..
    I assume you have created the RFC destination in NWA.
    Go to RFC destination ->Specific Data -> Advanced Settings - here we have an option to mention the code page.
    You might want to mention the code page for chinese char and see if it helps..
    Before doing this, do checkMark's suggestion.

  • How to use a select statement with chinese characters?

    I am currently developing a java servlet<using tomcat 4.x> which allows me to use select statement to retrieve results from the Microsoft SQL Server 2000 database. I am using a simple form to get the parameter for querying. The main problem i'm facing is that there are chinese information in the SQL database, but i can't retrieve it through the sql statement with the chinese characters input<thru the form with the help of NJ STAR>in the WHERE condition. When i execute the statement, it returns me no results even though the rows are present in the database.
    Does anyone have the solution to using chinese words in the WHERE clause of the select statement to retrieve results with columns which contains chinese characters? Please help me. Thanks everyone. :)
    PS: when i cut and paste those characters in the sql database and paste onto java.. it is ??? in questionmarks.. but when i paste them into excel 2000.. its shown as chinese chars again..
    please heelppp~~

    Greetings,
    PS: when i cut and paste those characters in thesql
    database and paste onto java.. it is ??? in
    questionmarks.. but when i paste them into excelThis is why the SELECT is not returning any results.
    You need to set the character encoding set on your
    statement and parameters for the characters to be
    properly translated. Refer to the charsetName
    parameter in the String class constructor in your API
    docs and also to
    $JDK_DOCS/guide/intl/encoding.doc.html in your JDK
    documentation.
    2000.. its shown as chinese chars again..Because Office programs are performing the same kind
    of character translation with the appropriate MS APIs.
    please heelppp~~Regards,
    Tony "Vee Schade" Cookis it possible for you to show me some coding examples? i don't really understand what is to be done in order to set the char set and what does it really do.. tried reading up but still dun understand.. :(
    pardon my shallow knowledge of java..
    ok..
    The thing is when i used an insert statement with chinese characters of GBK format hardcoded into the java servlet and then i use the insert statement to insert the chars into the database, it cannot be seen as a chinese word when i off the NJStar. and then it can be searched out with my current form of servlet.. below is my coding of the servlet..
    note: i've set my html file to charset = GBK
    //prototype of Search engine...
    //workable for GBK input and output...
    import java.io.*;
    import java.io.OutputStream;
    import java.io.IOException;
    import javax.servlet.http.*;
    import javax.servlet.ServletException;
    import java.util.*;
    import java.sql.*;
    import java.nio.charset.Charset;
    public class SearchBeta extends HttpServlet {
         private Vector musicDetails = new Vector();
         private String query = "";
         public void service (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException, UnsupportedEncodingException {
              query = req.getParameter ("T1");
              System.out.println("before:"+query);
              String type = req.getParameter ("D1");//type
              query = req.getParameter ("T1");
              //query = "������";
              System.out.println("after:"+query);
              getResults(type,query);
              System.out.println("locale = :"+req.getLocale());
              res.setContentType ("text/html;charset=GBK");
              PrintWriter out = res.getWriter();
              out.println("<html>");
              out.println("<head>");
              out.println("<body bgcolor = \"black\">");
              out.println("<font face = \"comic sans ms\" color=\"Cornsilk\">");
              if (query.length()==0)
                   out.println ("Please key in your search query.");
              else if (musicDetails.size()==0)
                   out.println ("Sorry, no results matching your search can be found.");
              else {
                   out.println("<center>");
                   out.println("<table cellspacing = \"50\">");
                   int i = 0;
                   //Display the details of the music
                   while (i<musicDetails.size()) {
                        Results details = (Results)musicDetails.get(i);
                        String dbArtist = "";
                        String dbAlbum = "";
                        String dbTitle = "";
                        String dbCompany = "";
                        dbAlbum = details.getAlbum();
                        dbTitle = details.getTitle();
                        dbCompany = details.getCompany();
                        dbArtist = details.getArtist();
                        try{
                             dbAlbum = new String(dbAlbum.getBytes("ISO-8859-1"),"GBK");
                             dbTitle = new String(dbTitle.getBytes("ISO-8859-1"),"GBK");
                             dbCompany = new String(dbCompany.getBytes("ISO-8859-1"),"GBK");
                             dbArtist = new String(dbArtist.getBytes("ISO-8859-1"),"GBK");//correct translation.
                        catch(UnsupportedEncodingException e){
                             System.out.print(e);
                             e.printStackTrace();
                        String dbImage_loc = details.getImage();
                        out.println("<tr>");
                             out.println("<td><table>");
                                  out.println("<img src=C:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\examples\\ThumbNails\\"+dbImage_loc+">");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Artist: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbArtist+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Title: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbTitle+"</font></td>");
                             out.println("</tr>");
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Company: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbCompany+"</font></td>");
                             out.println("</tr>");
                             System.out.println("album: "+ dbAlbum);
                             out.println("<tr>");
                                  out.println("<th><font color=\"violet\"> Album: </font></th>");
                                  out.println("<td><font color=\"Cornsilk\">"+dbAlbum+"</font></td>");
                             out.println("</tr>");
                             System.out.println("company: "+ dbCompany);
                             out.println("</table></td>");
                        out.println("</tr>");
                        i++;
                   out.println("</table>");
                   out.println("</center>");
              out.println("</font>");
              out.println("</body>");
              out.println("</head>");
              out.println("</html>");
              out.close();
              //to remove all the elements from the Vector
              musicDetails.removeAllElements();
         //get Searched Music Details and store in Results object which is stored in musicDetails vector
         public void getResults (String type, String searchQuery) {
              try {
                   Class.forName ("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                   Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=music","sa","kokkeng");
                   Statement stmt = con.createStatement();
                   String query = "SELECT * FROM MusicDetails WHERE "+type+" = '"+searchQuery+"'";
                   ResultSet rs = stmt.executeQuery(query);
                   while (rs.next()) {
                        String artist = rs.getString("Artist");
                        String title = rs.getString("Song");
                        String company = rs.getString("Company");
                        String album = rs.getString("Album");
                        String image_loc = rs.getString("Image");
                        Results details = new Results (artist,title,company,album,image_loc);
                        musicDetails.add(details);
                   stmt.close();
                   con.close();
              catch (Exception e) {
                   System.out.println(e.getMessage());
                   e.printStackTrace();
    with the above servlet i created, i can search out the data in the database which i've inserted through the insert statement. I still can't search for things i've keyed into the database directly using NJStar..
    thank you so much for helping.. really hope any one else who knows the answer to this will reply too... thank you all so much...
    -KK

  • Chinese Characters in Netlogon.log -- re-asking

    We have  822 occurrences of the following:
    [CRITICAL] I_NetlogonLdapLookup: unrecognized character <Chinese characters>
    in the last 2 days. The previous thread on this subject was marked "Answered" without being answered, so I'm re-asking:
    1. Does anyone have any substantive information about what's sourcing this?
    2. How can I associate a source IP with a single entry in the netlogon.log?
    Here's what we know so far:
    We have a Chinese linguist who has broken the character string down to 2 sections, the first being the same for all occurrences and the second being random-looking. He says the first section refers to "boats" or "water" and is looking
    farther, but he says the string definitely looks like virus-like activity.
    Second, I_NetlogonLdapLookup is a function inside netlogon.dll, so intuition says something is trying to do an LDAP lookup on the Chinese character string. We are looking into exactly how that function is supposed to be called (we're network guys, not
    coders, so this may take longer than it should). Can someone help shorten this search?
    C: There's no consistent contextual activity surrounding the actual log entries, so we're expecting to find out that there's  more than one source, so it's extra important we figure out how to associate a source IP with these [CRITICAL] log entries,
    especially since we may be looking for a root kit or something else that's able to hide from our multiple AV programs.
    Assistance is appreciated, good analytical step-oriented result-generating assistance is GREATLY appreciated!
    Robert
    Oh yeah -- this is being logged on a DC in a 2008R2 domain with a small but growing number of 2012 member servers and almost no remaining servers lower than 2008R2. I can provide more details if anyone needs them

    Hi all --
    OK. It looks like we're all on the same page.
    Here's a summary of the issue:
    netlogon.log [CRITICAL] entry is  reporting a failed attempt to execute an LDAP lookup on a Chinese character string (I_NetlogonLDAPLookup is a function inside netlogon.dll). There are no audit failures or other Event Log warnings or errors associated
    with the log entries, so it's likely that the lookup is being performed after logging on to the domain with valid credentials. We don't think the character string is corrupted data because the first half of the string is identical in every
    log entry and the total number of characters used across all occurrences is very small). Also, the variations in the 2nd half of the string are methodical and repetitive.
    We hoped that translating the Chinese string would yield a clue pointing to the source of the attempted LDAP lookup. That didn't happen so we now must figure out how work back from the netlogon.log entry to the source platform.
    The current situation:
    The [CRITICAL] entries continue to be logged.
    The distribution across 3 days of logs is making it look like we need to assume not one, but multiple sources.
    I appreciate the standard advice re: 3rd-party AV software, DC build practices, security scans, power erasers and the like, but we are a QA/Test lab for a very complex product; scientific method and the need for operational stability preempts
    us taking any corrective actions on any of our DCs (8 machines, 4 domains, 2 forests), Exchange servers (4 versions, 2 clusters per version) , Lync (2 versions), OCS, PKI, WSUS, DNS, DHCP, DHCPv6, SQL, or member servers until we actually prove that the machine in
    question is a source of the bogus lookup attempts.
    Paul -- I REALLY appreciate your straightforward no-bs reply. I can work with "I don't know" . Try-this-article-I-just -Googled Whack-A-Mole easter egg hunts, however....   <grin>
    I'm going to close with one last (hopefully ) simple question: Where do I start the search for the UberSME who knows how to read the netlogon.log - specifically how to connect an event with its legitimate predecessor. Somebody
    wrote the service, somebody knows how to interpret its logging output. Where do I start looking for them?
    Best Regards,
    Robert

  • Insert chinese characters in oracle81 database(with code here)

    Hi all,
    I have problem on insert chinese characters in oracle8i database(with code below). But no problem when display chinese characters in HTML( not include in the follow program)
    Can anyone help me?????
    In unix:
    Database setting:
    charset: ZHT16BIG5
    version:8.1.7
    In NT 4.0 with SP5:
    web/app server setting
    webserver: iWs4.0.1
    appserver: iAs6.0
    Java 1.2.2 with download classes12.zip/nls_charset12.zip
    JDBC thin driver
    code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    import java.util.*;
    import java.lang.*;
    import java.lang.reflect.*;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.math.*;
    import oracle.sql.*;
    public class updatedata extends HttpServlet
    Connection dbCon = null;
    ResultSet rs = null;
    DataSource ds1 = null;
    String input_data = "";
    public void doGet(HttpServletRequest req, HttpServletResponse res)
         throws ServletException,IOException{
         input_data = req.getParameter("chinese_input");
    res.setContentType("text/html; charset=BIG5");
    PrintWriter out = res.getWriter();
    // draw a table
    ConnDB(out);
    DrawTable(out);
    public void JDBC(PrintWriter out) throws NamingException {
    InitialContext ctx = null;
    String dsName1 = null;
    Connection conn = null;
         dsName1 = "jdbc/project";
         try {
    ctx = new InitialContext();
    ds1 = (DataSource)ctx.lookup(dsName1);
         }catch (NamingException e) {
         out.println("exception in servlet in JDBC : " + e.toString());
    /** big5 to unicode conversion **/
    private String b2u(String str2convert)
         throws IOException {
         StringBuffer buffer = new StringBuffer();
         byte[] targetBytes = str2convert.getBytes();
         ByteArrayInputStream stream = new ByteArrayInputStream(targetBytes);
         InputStreamReader isr=new InputStreamReader(stream, "BIG5");
         Reader in = new BufferedReader(isr);
         int chInt;
         while ( (chInt = in.read()) > -1 ) {
              buffer.append((char)chInt);
         in.close();
         return buffer.toString();
    private void DrawTable(PrintWriter out){
    try{
         try{
         // update data
         String u="update test_chinese set chinese_script=? where prod_cd=?";
         String sProd = "T1";
         PreparedStatement ps = dbCon.prepareStatement(u);
         ps.setString(1, input_data);
         ps.setString(2, sProd);
         ps.executeUpdate();
         dbCon.commit();
         catch(SQLException e){
              out.println("exception in insert: " + e.toString());
    out.println("<html>");
    out.println("<body>");
    out.println("update success!!!!");
         out.println("</body>");
    out.println("</html>");
         catch(Exception e){
         out.println("exception in servlet in statement: " + e.toString());
    private Connection ConnDB(PrintWriter out){
         try{
         try{
              JDBC(out);
         catch (Exception e) {
              out.println("Database connect failed (init)");
              out.println(e.toString());
              return null;
         dbCon = ds1.getConnection();
         catch(Exception e){
         out.println("exception in servlet in connection: " + e.toString());
    return dbCon;
    public void destroy() {
    //Close database connection
    try {
    dbCon.close();
    catch (Exception e) {
    System.out.println("Error closing database (destroy)");
    System.out.println(e.toString());

    Hi, Jenny,
    When you said unable to insert to database, do you mean you get all ? marks in the database or garbage characters in the database?
    ? marks mean there are some byte chop off, and garbage characters mean the bytes are ok, just encoding problem.
    --Lichu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Pls help.JSP: I could not store Chinese characters into files.

    Hi experts,
    I have this problem of cant store chinese characters into files(eg. .txt and .properties). I am adding
    these chinese text through a JSP website form....After i key in chinese characters in the textboxes
    in the website and sumbit the results, my chinese characters turned into ASCII or rather garbage in
    the files.
    Is there any way i can get the exact chinese characters i entered in the webite into the files?
    Need urgent assistance here.
    Thanks
    <%@ page contentType="text/html; charset=big5" %>
    <html>
    <head>
    <title>Confirmation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    </head>
    <%@ page language="java"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.lang.Integer.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.sql.ResultSet.*"%>
    <%@ page import="javax.servlet.*"%>
    <%@ page import="javax.servlet.http.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.net.URL"%>
    <%
    //getting attributes from previous page form
    //At this point, chinese characters r retrieved
    //Ascii/garbage displayed for text when retrieved from previous page.
    String gameName=request.getParameter("name");
    String encode=request.getParameter("encode");
    String gameType=request.getParameter("type");
    String info=request.getParameter("description");
    int check=0;
    int nextGameID;
    String temp="";
    String langCode="";
    //establish connection
    Connection con = null;
    try {
    Class.forName("org.postgresql.Driver");
    con = DriverManager.getConnection("jdbc:postgresql://172.20.134.110:5432/smsINTFET" , "postgres",
    "postgres");
    catch(ClassNotFoundException e) {
    out.println("Could not load the driver: "+e.getMessage());
    catch(SQLException e) {
    out.println("SQLException caught in relax db: "+ e.getMessage());
    Statement stmt = null;
    ResultSet rs = null;
    ResultSet ps = null;
    String strSQL = "";
    String strSQL2 = "";
    String tempCat = "";
    strSQL="SELECT gamename FROM cp_games order by gameid;";
    try {
    stmt = con.createStatement();
    rs = stmt.executeQuery(strSQL);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    while(rs.next())
    check=0;
    temp=rs.getString("gamename");
    if(temp.equalsIgnoreCase(gameName))
    // there is similar record in database
    check=1;
    break;
    else
    check=0;
    if(check==0)
    %>
    <body background="button/bkgd.jpg" bgproperties="fixed">
    <p><b><font size="30pts" face="Monotype Corsiva">Confirmation</font></b></p>
    <HR style="WIDTH: 500px; COLOR: blue; HEIGHT: 3px">
    The following information has been added.
    <table width="75%" border="0" cellspacing="0" cellpadding="2">
    <%
    String strCat="";
    strCat="INSERT INTO cp_games(gamename,description,encode) values('"+gameName+"','"+info+"','"+encode+"');";
    stmt = con.createStatement();
    stmt.executeUpdate(strCat);
    System.out.println("Successful inserted category");
    stmt.close();
    //setting language
    if(encode.equals("ascii"))
    langCode = "US";
    if(encode.equals("ms950"))
    langCode = "TW";
    if(encode.equals("ms936"))
    langCode = "CN";
    strSQL2="SELECT gameid FROM cp_games where gamename = '"+gameName+"';";
    try {
    stmt = con.createStatement();
    ps = stmt.executeQuery(strSQL2);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    ps.next();
    nextGameID=ps.getInt("gameid");
    out.println("<B>The game number : </B>" + nextGameID);
    %>
    <tr>
    <td><B>Game added: </B><%=gameName%>
    </td>
    </tr>
    </table>
    <%
    String newFile="G:\\home\\smsGamesINTV2\\colorGame\\propertiesFiles\\FET\\CP_Game"+nextGameID+"_"+encode+"_"+langCode+".properties";
    try
    {               //begin file
    PrintWriter outFile=null;
    //create a new file and write the initial settings to file
    outFile=new PrintWriter(new FileOutputStream(newFile,true));
    outFile.println("game_intro="+nextGameID+")"+gameName+" - "+info);
    outFile.println("");
    outFile.println("game_title="+gameName);
    outFile.println("");
    outFile.println("game_type="+gameType);
    outFile.println("");
    outFile.println("qns_no=0");
    outFile.println("");
    outFile.println("ana_no=0");
    outFile.close();
    }//end file
    catch(IOException e)
    out.println("File Create Error");
    else // no match found
    out.println("Game,"+temp+ " already added");
    %>
    </body>
    </html>

    try to add this code under this line:
    <%@ page contentType="text/html; charset=big5" %>
    <% response.setContentType("text/html; charset=big5"); %>
    I have faced the problem like yours and it works fine for me. Try and see.

  • How to store and retrieve chinese characters

    Hi, I am facing some problem in storing and retrieving of chinese characters from oracle,9i .
    This is the character i am trying to store into the database
    自动提款机网络
    while trying to retrieve it, it shows
    自?提款机网?
    ^ ^
    you can see the weird characters like ? at some places.
    here is the sample code which i can using to store and retrieve data from the database
    class testInsert
    public static void main(String[] args)
    try {
         DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
         Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@172.16.6.81:1521:JFPPTDB1", "citi_user", "citi_user");
         int employee_id = 12345;
    String ename = "自动提款机网络";
         oracle.jdbc.OraclePreparedStatement pstmt = (oracle.jdbc.OraclePreparedStatement)conn.prepareStatement("INSERT INTO employees (employee_id, last_name) VALUES (?, ?)");
         pstmt.setFormOfUse(2, oracle.jdbc.OraclePreparedStatement.FORM_NCHAR);
         pstmt.setInt(1, employee_id);
         pstmt.setString(2, ename);
         pstmt.execute();
    pstmt.close();
    pstmt = (oracle.jdbc.OraclePreparedStatement)conn.prepareStatement("SELECT last_name, employee_id from employees");
    ResultSet rset = pstmt.executeQuery();
              String name = "";
              while(rset.next())
                   name = rset.getString(1);
         int id = rset.getInt(2);
              System.out.println("the name is :"+name);
    catch (SQLException sqe)
              System.out.println("Java SQLException caught, error message="+sqe.getMessage());
    and the table in oracle is
    SQL> desc employees;
    Name Null? Type
    LAST_NAME NVARCHAR2(10)
    EMPLOYEE_ID NUMBER
    I am using classes12.zip for oracle,9i. Is there any database setting that i need to know to retrieve the chinese characters?.
    I have been facing this problem for quite sometime and it makes my life tough. Please help me in solving this issue.
    Thanks
    PD

    hi, can you retrieve the chinese character from your os? When it comes to the wild code of asian character, you should focus on the database/client character setting. you may ask more about it from your dba.
    have a nice weekend!
    eilison
    [email protected]

Maybe you are looking for

  • Need help in understanding native VLAN or PVID concent

    Hi: I am fairly new to VLANs. I can't seem to understand how native VLAN or PVID concept works. I found descriptions for native VLAN. But what I donot understand is the following scenario: Letz say a port is a member of VLANs 1 and 2. The PVID for th

  • Free Item in Purchase Order Item

    Hello All, I would like to ask where in table level can I identify Purchase Orders which have "Free Item".  Because on the screen field i saw from the technical definition that the "Free Item" is of field MEPO1211-UMSON, but when I go to EKPO I canno

  • Best practice for "Quantity" field in Asset Master

    Hi I want to know what is the best practice for "Quantity field" in asset master. It should be made displayed only or required field in Asset Master creation. Initially I made this field as required entry. So user entered 1 quantity. At the time of p

  • How do you connect iPad to TV?

    I've connected the HDMI cable to the back of an ordinary flat screen TV, then put the other end of the HDMI cable into the 30 pin Digital AV adapter. I've connected the other end of the 30 pin Digital adapter to my iPad. Switched TV on and nothing. D

  • Drag and drop between two Datagrid

    I have to drag and drop data between two different datagrid but in drop side i have to modify the item. How Can I do it? Thanks A