Insert Arabic through Servlet

Hi,
I am able to read Arabic characters through servlets and able to display in a browser .
But when I try to insert Arabic characters to Oracle Database through servlets ,
it is saved as ??????? or inverted question marks
Kindly help me resolve this issue.
Thanks and Regards
Jailani

and since email replies won't work with the "<>" chars in them:
in application.cfm
<cfset setEncoding("url","UTF-8")>
<cfset setEncoding("form","UTF-8")>
<cfcontent type="text/html; charset=UTF-8">
at the top of your cf pages add:
<cfprocessingdirective pageEncoding="UTF-8">

Similar Messages

  • How to insert arabic&english  from oracle clients like TOAD,SQL*PLUS

    Hi
    iam trying to insert arabic&english data from TOAD&SQLPLUS.
    if i try to insert arabic by copy and paste iam getting ???? and
    if i try to insert through my keyboard (after updating my system with regional
    settings) iam able to type some junk characters.
    I have installed Oracle 8.1.6 with characterset set to UTF8 and
    in my client NLS_LANG settings i have tried with different settings like:-
    AMERICAN_AMERICA.UTF8
    AMERICAN_AMERICA.AR8MSAWIN
    ARABIC_UNITED ARAB EMIRATES.UTF8
    ARABIC_UNITED ARAB EMIRATES.AR8MSWIN1256
    i have also updated INIT.ORA nls_language ='ARABIC'.
    but still iam getting same problem.
    any help in this appriciated.
    Thanks
    Srinivas

    Are you able to use Arabic with your Java VM in general? Or are you having problems specific to your database interactions? Sun provides an internationalized version of the JDK and also an "English only" version. Perhaps you have the English only version? I would recommend trying a simple Hello World app with your JVM first... I would also check your JDBC driver documentation and make sure there are no limitations there, and that your database is also setup for internationalization.
    It is certainly possible to use TopLink in internationalized environments as we have lots of customers doing this, so hopefully we can figure out what is wrong with your setup.
    - Don

  • Not able to retrieve data from database through servlet

    Hi friends,
    I am trying to open a excel sheet through servlet. In this servlet i am retriving data from mssql database.I am not getting any error but no data is retrived
    i m also pasting the code here
    // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://www.kpdus.com/jad.html
    // Decompiler options: packimports(3)
    // Source File Name:   EmployeeData.java
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    public class EmployeeData extends HttpServlet
        public EmployeeData()
        public void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            httpservletresponse.setContentType("text/html");
            httpservletresponse.setHeader("Content-Type", "application/excel");
            httpservletresponse.setHeader("Content-Disposition", "filename=reports.xls");
            PrintWriter printwriter = httpservletresponse.getWriter();
            try
                javax.servlet.http.HttpSession httpsession = httpservletrequest.getSession(true);
                int i = 0;
             /*   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
                Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:3413;DatabaseName=newreportsodbc", "reportuser", "cisco");*/
                String url="jdbc:odbc:newreportsodbc";
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
                Connection connection = DriverManager.getConnection("jdbc:odbc:newreportsodbc","reportuser","cisco");
                Statement statement = connection.createStatement();
                printwriter.println("<b><center><u> Search Results </u></center></b>");
                printwriter.print("<table><tr><th color=brown background-color=#fff000>  No.  </th>");
                printwriter.print("<th> DateTime      </th></tr></table>");
           ResultSet resultset = statement.executeQuery("SELECT * FROM t_Call_Type_Half_Hour");
                boolean flag;
                for(flag = false; resultset.next(); flag = true)
                    i++;
                    SerialNo = resultset.getString(2);
                    printwriter.print((new StringBuilder()).append("<table><tr><td> ").append(i).append("</td>").toString());
                    printwriter.print((new StringBuilder()).append("<td> ").append(SerialNo).append("</td></tr></table>").toString());
                if(!flag)
                    printwriter.println("<h1> No records selected </h1>");
            catch(Exception exception)
                System.out.println((new StringBuilder()).append("SQLException: ").append(exception).toString());
        static String empid1;
        static String empid;
        static String SerialNo;
        static String designation;
    }thanks in advance. i just feel there is something to be done with connection string.

    post the table format in SQL

  • Store Image through Servlet

    I want to store a JPG image into database column through Servlet
    and dispaly it on a JSP page through Beans
    how can i ?

    Any requests made to a JSP are of a certain content. Generally you make a request to a JSP page it sends back a "text/html" document. There is noi binary data as such just text.
    Images on a page are displayed because the "src" attribute of the image tag points to a server location. This in turn returns content of type "image/*".
    A servlet can retrieve/generate your images for you for example you could point to a servlet:
    <img src="/system/imageServlet">
    I guess a JSP can do the same (I've never tried it) just remember to set the response.contentType to "image/gif"/"image/jpg".....
    Cheers,
    Anthony

  • Problem in opening .ics and .vcs file types through servlet in IE browser.

    I'm having problem in downloading an .ics and .vcs file through servlet in I.E browser. It is happening fine in Mozilla firefox(they both are getting opened in OutLook), but in IE it says as undefined file type.
    I'm using Content Type as : 'text/Calendar' and then setting header as :
    response().setContentType("text/Calendar");
    response().setContentLength(file.length());
    response().setHeader("Content-Disposition", "attachment;
    filename="+filepath);
    and after that i'm writing it to OutPut stream.
    Plz Help.

    Hi,
    On page load check whether the session values are there. If not redirect the user to the login page.
    Hope this helps,
    Regards,
    Sammani

  • Objects through servlet

    How to pass the object through servlet?

    I can venture a guess that the OP wants to 'send' an object as a request parameter or a form field.
    You'd have to turn the object into some data representation that can later on be translated back into the object; serialization comes to mind. It might be easier to just send the properties of the object as seperate request/form fields though!

  • Oracle NoSQL through Servlet.

    Hello Everyone,
    I am trying to execute the nosql operations on server through servlet. I want to make an client server application but dont know why the CONNECTION TO KVSTORE IS NOT ESTABLISHED WHILE EXECUTING ON SERVLET.
    So is there any separate configuration needed to do so?
    Thanks In Advance.

    Could you be more explicit please?  What is the exact error you are seeing?
    Please explain in detail what is the issue you're facing.
    If you want to access an Oracle NoSQL Database KVStore through a servlet the best way would be to use a ServletContextListener in your web app that gets the KVStore handle and places it in application/context scope as an attribute (so that all servlets and JSPs would have access to it) and also closes the handle when the web app gets shut down.  You could even supply the store name, store host name and store host port (the helper host port -- hostName:hostPort) through the web.xml web app config file.
    Here is a simple example of such a ServletContextListener:
    import javax.servlet.ServletContext;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContextListener;
    import javax.servlet.annotation.WebListener;
    import oracle.kv.KVStore;
    import oracle.kv.KVStoreConfig;
    import oracle.kv.KVStoreFactory;
    * KVStoreClientContextListener implements ServletContextListener, hence it will be
    * invoked when the application context is initialized and destroyed.
    * @author Andrei Costache
    @WebListener
    public class KVStoreClientContextListener implements ServletContextListener {
        @Override
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext sc = sce.getServletContext();
            KVStore ondbstore = null;
            try {
                // Try to get the store name, store host name and store host port from web.xml,  as context attributes.
                // If they are not available, then default to the values specific to a default KVLite instance.
                String storeName = (String) sc.getAttribute("storeName");
                String hostName = (String) sc.getAttribute("hostName");
                String hostPort = (String) sc.getAttribute("hostPort");
                if (storeName == null) {
                    storeName = "kvstore";
                if (hostName == null) {
                    hostName = "localhost";
                if (hostPort == null) {
                    hostPort = "5000";
                // Get the KVStore and place it as an atribute in application/context scope.
                ondbstore = KVStoreFactory.getStore(new KVStoreConfig(storeName, hostName + ":" + hostPort));
                sc.setAttribute("ondbstore", ondbstore);
            } catch (Exception e) {
                sc.log("Could not get a KVStore instance");
        @Override
        public void contextDestroyed(ServletContextEvent sce) {
            KVStore ondbstore = null;
            ServletContext sc = sce.getServletContext();
            try {
                ondbstore = (KVStore) sc.getAttribute("ondbstore");
                if(ondbstore != null) {
                    ondbstore.close();
            } catch (Exception e) {
                sc.log("Could not successfully close the KVStore handles");
    In your servlets or JSPs you will simply retrieve the KVStore handle from the servlet context, where it is found as a context scope attribute:
    KVStore ondbstore = (KVStore) getServletContext().getAttribute("ondbstore");
    and do whatever operations you want using the KVStore handle.
    You will need the NoSQL Database kvclient.jar -- either your web container / application server can load it, or you could copy it under the WEB-INF/lib directory so that it gets loaded when your web app gets deployed and started.  (kvclient.jar is found under kv-M.N.P/lib).
    Regards,
    Andrei

  • Running an executable file through servlet

    Hello People,
    I tried searching about this on the Forums, but could not find the right solution.
    Please donot get annoyed if you find this to be a repeted topic, which I am sure is not.
    I want to run a .sh file in Unix environment through servlet.
    Actually i want to do this inorder to schedule a report servet to run a report and generate the output in a particular format on a click of a button.
    I tried using Runtime.getRuntime().exec method, (which I know through forum is unreliable)
    Can anyone suggest me a method through I can achieve this?
    Any suggestion is appreciated.
    Regards,
    Rohan Kamat

    Hi MOD,
    Thanks for the quick reply.
    Heres what I am doing to schedule.
    1) The client selects the necessary parameters from the front end and then saves it in a table.
    2) This he will be doing for as many reports as he wants, on an average there will be 200 reports daily.
    3) Once he has selected all the parameters for all the reports, he will go to the next screen and fire a script to run the reports at a time.
    4) This script will be fired only once. And once it is fired it will generate a PDF files of the reports.
    5) On the front end the screen will be refreshed showing the users the status of the reports that he has scheduled to be run
    I am using Servlets 2.0 version, and jdk.12
    Regards,
    Rohan Kamat

  • Working with markups through servlet

    Hello,
    There is several problems with using Autovue through servlet.
    Fabula:
    Servlet receives http request, connect to the vue server (vue servlet via ServerControl), load .dwg file into
    vuebean by vuebean.setFile(new DocID(fileName)) and load markup by simple calling markupbean.readMarkup(FileInputStream instance) method.
    I get a markup file name by parsing 'markups.map'. Servlet modifies markup by http request parameters (set new FillColor, for example) and saves markup file -
    markupbean.writeMarkup(FileOutputStream) - very simple process.
    Problems:
    1. After markup changing i need to open dwg with markup (in applet), but i don't know how i can to do this. jVue.openMarkup() doesn't work - i don't understand what parameters are needed.
    2. When markup open via jVue applet GUI, changed TextBox elements are not visible, but presents in markup items list.
    If TextBox is selected it becomes visible! If I change the text or position of TextBox, it will become visible (without selection). This situation applies only to TextBoxes.
    Any suggestions how I can load markups into GUI and fix visibility of TextBoxes after saving via FileOutputStream.

    Hello,
    May I point out some issues where you are implementing code that is not supported nor documented (and probably will not) and consequently help on those topics is not available
    1. I get a markup file name by parsing 'markups.map' -> not documented, not supported, could change on any release.
    2. markupbean.writeMarkup(FileOutputStream) -> where? local datastore is not documented, will need synching, writing to it directly not supported, could change on any release.
    Stating it as a simple action is probably not the best way to describe a over-complicated solution piggybacking on a closed (undocumented) implementation
    Hence my recommendation for an open and properly documented platform
    Perhaps you should have started by describing what you are trying to do
    If what you want to implement is to save markups with a predefined name, then your solution is an overkill (and goes in the wrong direction)
    If you would be kind enough to
    1. follow this forum's rules ie https://forums.oracle.com/forums/ann.jspa?annID=1527
    2. properly state what you are trying to implement in another thread, if possible as it will make search/review easier to the rest of the community
    3. Have a tittle that is descriptive enough
    4. is this solution required to work on a cluster (ie more than one AV server)?

  • Displaying Images through Servlets

    I am using Servletrunner utility to run my servlets. How can I display Images along with other HTML text, to the Browsers through Servlets?

    Print out the <img> tag. The URL you use may in turn reference another servlet that produces an image. You can look at the Java2D (and perhaps Java3D, if you want 3D images) to help you produce the images.

  • Padding in excel  output through servlet,jsp

    Hi ,
    i want response through servlet in excel format.i am using the code lines below.
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment; filename=pif_excel_asp.xls");
    Now i am unable to pad the string with spaces which i am getting through database.can anyone help me.?Thx in advance
    Cheers:
    Akash

    Hi,
    Did you solve your problem? I have the same problem.
    The report fails to run and I get Java error when I follow the example shown in Oracle® Reports Building Reports 10g Release 2 (10.1.2) Chapter 29 to build a jsp.
    Regards,
    neemin

  • Inserting Image on a HTML page through servlet

    I want to insert an image on a HTML page which will be generated by a servlet.For that I have written the <IMG SRC>tag.But my doubt is where to store the image(i.e in which directory of the web server) I should store the Image.I am using JavaWebServer2.0.
    please help

    You can put your images in public_html directory.

  • Uploading pictures into database through servlet

    I'm having problems uploading pictures from servlet to a database:
    public Exception storePicture(byte[] bytes, String fileName){
              int fileNo;
              try{
                   if(!SELECT_FILENAME_NO.execute()){
                        return new Exception("number select");
                   ResultSet resultSet = SELECT_FILENAME_NO.getResultSet();
                   if( resultSet.next() ){
                        fileNo = resultSet.getInt( "nextval" );
                   }else{
                        return new Exception("resultset number");
                   INSERT_PICTURE_BYTES.setBytes(1, bytes);
                   INSERT_PICTURE_BYTES.setString( 2, fileName );
                   INSERT_PICTURE_BYTES.setInt(3, 0);
                   if(INSERT_PICTURE_BYTES.executeUpdate() > 0){
                        return new Exception("insert_bytes");
              } catch (SQLException e) {
                   e.printStackTrace();
                   return e;
              return new Exception("end");
         }with this code I get error message: Data size bigger than max size for this type: 142485.
    with a picture of only 150kB
    The exception is thrown on the setBytes line.
    I also tried to add
    ByteArrayInputStream input = new ByteArrayInputStream(bytes);
    INSERT_PICTURE_BYTES.setBinaryStream(1, input, bytes.length);and..
    InputStream in = input;
    INSERT_PICTURE_BYTES.setBinaryStream(1, in, bytes.length);...both giving error message: Io exception: Connection reset.
    The exception is thrown on the setBinaryStream line.
    I have never done this before and I can't figure out what to do. Anyone?
    thanks

    INSERT_PICTURE_BYTES = connection.prepareStatement("INSERT INTO pictures(picture, fileName, approved) values(?, ?, ?)");Io exception: Connection reset
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
    oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    rockIt.db.PictureDAO.storePicture(PictureDAO.java:113)
    rockIt.control.DbController.storePicture(DbController.java:201)
    servlets.main.Upload.doPost(Upload.java:69)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
    org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    java.lang.Thread.run(Thread.java:619)

  • Best Practice for ViewObjects when inserting data through pl/sql procedure

    My applications is oracle form based enterprise level application and we are now developing new module in ADF 11g but there is restriction that all data insertion, updation, and deletion will be through oracle pl/sql procedures. Now my question is that adf pages should be binded with ViewObjects based on Entity Object or with Viewobjects not based on Entity / sql query. Currently I have developed pages with programmatic ViewObjects which are neither based on Entity Objects nor on sql query. In those view objects, i create transient attributes and then used it to create adf pages. Then on save, i extract the data from ViewObject's current row and pass it to procedure. This is working fine but just wondering whether this approach is ok or there is better alternative for that. Ideally i want to create ViewObjects based on EntityObject but don't finding any way to synchronize entityObjects with data inserted through procedures.

    Hi,
    I create a EO for the Database-View and override the doDML()-Method. For insert/update and delete I call the pl/sql-functions.
    See "38.5 Basing an Entity Object on a PL/SQL Package API" in Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development
    Framework.

  • Updating through servlet fails!

    Hello everyone!
    I have a servlet which updates the emps table in oracle database.
    --the code
    package oz;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    public class UpdateScottEmployees extends HttpServlet{
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws ServletException,IOException{
    doPost(request,response);
    }//doPGet
    public void doPost(HttpServletRequest request,HttpServletResponse response)
    throws ServletException,IOException{
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    Connection cn = null;
    Statement stm = null;
    try{
    //Load the driver
    Driver drv = (Driver) Class.forName("JData2_0.sql.$Driver").newInstance();
    //Oracle Connection
    cn = DriverManager.getConnection("jdbc:JDataConnect://zaf/scott_emp:scott:tiger");
    stm = cn.createStatement();
    String upd = "INSERT INTO emp(empno,ename,job,mgr,hiredate,sal,comm,deptno)" +
    "VALUES(" +
    request.getParameter("theempno") + "," +
    "\"" + request.getParameter("theename") + "\"," +
    "\"" + request.getParameter("thejob") + "\"," +
    request.getParameter("themgr") + "," +
    "\"" + request.getParameter("thedate") + "\"," +
    request.getParameter("thesal") + "," +
    request.getParameter("thecomm") + "," +
    request.getParameter("thedeptno") + ")";
    stm.executeUpdate(upd);
    cn.close();
    stm.close();
    out.println("<P>Update done!</P>");
    }catch(Exception e){
    out.println(e.toString());
    }//doPost
    }// UpdateScottEmployees
    and the html file
    <HTML><HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    <H3 align="center">Update form</H3>
    <BR>
    <FORM ACTION="../../servlet/oz.UpdateScottEmployees" METHOD="POST">
    Employee number:<INPUT TYPE="text" NAME="theempno"><BR>
    Employee name:<INPUT TYPE="text" NAME="thename"><BR>
    Employee job:<INPUT TYPE="text" NAME="thejob"><BR>
    Employee manager:<INPUT TYPE="text" NAME="themgr"><BR>
    Employee hiredate:<INPUT TYPE="text" NAME="thedate"><BR>
    Employee sal:<INPUT TYPE="text" NAME="thesal"><BR>
    Employee commission:<INPUT TYPE="text" NAME="thecomm"><BR>
    Employee Department no:<INPUT TYPE="text" NAME="thedeptno"><BR>
    <INPUT TYPE="SUBMIT" VALUE="update">
    </FORM>
    </BODY>
    </HTML>
    When i click the submit button i get the following message:
    java.lang.ClassNotFoundException: JData2_0.sql.$Driver
    However i have tried the driver class and it seems to work. What's the problem?
    Any help would be appreciated!
    Thanks in advance!

    Hello again!
    I think my classpath is set correctly because a simple java program placed in the same directory succeeds with the connection.Do you think the problem is placing the driver class inside doGet() or doPost() ?

Maybe you are looking for

  • JIT  delivery schedule tab in Scheduling agreement is greyed out.

    Hi all ! The "TAB JIT delivery schedule" is not accessible when creating a new Schedule line agreement. Where do i change the settings so that this TAB is available to me. Thanks and regards, vijay

  • Logo appearing in print preview but not in print for Xerox Workcentre M118

    Hello experts, I am not able to print logo(in .bmp) format in Xerox Workcentre M118 PCL 6 printer. It is displaying accurately in print preview. While taking print out only grey background is coming, no trace of logo. Can anyone suggest, what are the

  • I can't drag and drop files into iTunes - any ideas?

    As I often do, I went to drag four new files into a playlist in iTunes and suddenly they will not go in.  I just get that circle with a diagonal line across indicating that this is not possible.  Lately iTunes has been giving me all sorts of problems

  • Transfering Documents (mostly .jpg) from Services for Object to DMS

    Hi, We are presently in the process of finalizing document attachments via DMS system. We still have a high quantity of documents that were attached through the "Services for object" function (mostly .jpg ) and would like to transfer these to DMS wit

  • Function module :amount _convert_string

    hi to all plz help me in this issue, when iam using this fm for EUR it is woking fine but when taking other country currencies it is run time error t0 203. our standrads are for ISK no decimals and for other correncies 2 decimal places.plz help me in