How to tell JSP for encoding Format??

Hi all,
I have following requirements
1. The user enters data in local language say kannada(indian langauage). The data should be stored in ms-access only in the form of local langauge. Customer dosnt want see some junk values or entity values. His requirement is such that he sometimes changes the data from back end. So he wants data must be stored in local lanuage only.
2. He can enter english letters also, the storage must be in kannada(i.e local language) converted form.
3. when he renders the values into JSP, the display can be either in local language or english. Here the focus is to store the data in ms-access in kannada only for both the 1&2 cases.
What i have done
I wrote two JSP's
1. The first JSP has two text fields which accepts two inputs from the user. It encodes the data in unicode and sends the data as a part of URL to the second JSP. I wrote the following code. login.jsp
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
</head>
<!--<body text="blue" bgcolor="#87CEFA" font-family="arial">-->
<body text="blue" bgcolor="#87CEFA" font-family="chiller">
<form action="p3.jsp">
<center>
<br><br>
<input type="text" name="name"><br><br>
<input type="text" name="address">
<br><br>
<input type="submit" value="ADD"/>
</center>
</form>
</body>
</html>
2. In second JSP i connect to the ms-access data base and execute insert query. After insertion i write select query to render the values. I say to getConnection method that the data going to insert should be in UTF-8 format by using properties parameter got getConnection() method. The following code is p3.jsp
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<body text="blue" bgcolor="#87CEFA" font-family="algerian">
<%System.out.println("Before the filter is executed in JSP*********************************************");
String name=request.getParameter("name");
String address=request.getParameter("address");
%>
<script>
alert("<%=request.getParameter("name").trim()%>");
alert("<%=request.getParameter("address")%>");
</script>
<% try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// set this to a MS Access DB you have on your machine
String filename = "C:/database/db1.mdb";
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
// now we can get the connection from the DriverManager
Properties props = new java.util.Properties();
props.put("user", "");
props.put ("password", "");
props.put ("charSet", "UTF-8");
props.put("lc_ctype", "UTF-8");
Connection con = DriverManager.getConnection( database,props);
ResultSet rs=null;
Statement statement=null;
statement = con.createStatement();
System.out.println("name of the emp$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"+name);
String query="insert into Table1(name,number1) values(' " name " ' , ' "+ address +" ')";
String query1="select * from Table1";
statement.execute(query);
rs=statement.executeQuery(query1);
//ArrayList arr=new ArrayList();
while(rs.next())
String name1=rs.getString("name");
%>
<br>
<h>The fetched name from the database is<h>
<br>
<%=name1%>
<br>
<% }
con.close();
catch (Exception e) {
System.out.println("Error: " + e.getMessage());
System.out.println("After the filter is executed in JSP******************************************");
%>
<br><br>
</body>
</html>
The problem am facing
1. Am not able to store kannada characters in ms-access but while displaying i get local language characters. Physically am not able to see in ms-access. It stores some western europian language.
Issues
1. The issues are.. If user wants to enter english data how can i convert those english characters into kannada and store it in ms-access. and from back end all kannada characters into English
plz suggest me to do the above work. I cannot use oracle. I must use ms-access only.

My guess is that the requirements are impossible.
But as a start certainly you should at least verify that you can get the two character sets in there at the same time. I don't suppose that will work, and certainly would be a good demonstration as to why it is impossible.
You can look at the following bug
[http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6345277]
You might look at the only other real MS Access driver which is commercial and java only. It might support it.

Similar Messages

  • How can I know the encoding format for a file.

    I have files encoded in English, Spanish, Japanese etc. I want to know which file has which encoding format while reading.
    Can anyone suggest.
    Ashish

    Language is different from "encoding"...if you mean character encoding. Multiple languages can be represented by a single encoding. The fact that you mix language and encoding in your question confuses me about what you are asking.
    If you want to know what language a file uses, you can always use a meta-tag. Or you can do some kind of text analysis based on dictionary lookups to determine language...too complex for my tastes. I think a simple language tag in the file makes more sense.
    As for character encoding, you either standardize on a single encoding for all files or again use a meta-tag. If you standardize on a single encoding, you should probably consider one of the Unicode encodings instead of any other character set encoding.
    Regards,
    John O'Conner

  • How much to charge for encoding?

    I'm used to getting materials that are already pre-encoded/compressed from Final Cut Pro to a format I can use in DVD Studio Pro. I've been asked to bid on a project that would be 90-100 minutes in length that would have me do the encoding via Compressor and I'm not quite sure what to charge (as it would take hours and hours to do, I'm not sure my regular hourly rate would be appropriate, but don't want to screw myself out of $$$ either, especially since it would tie up the computer for a while).
    What would be a good rate (I'm in the New York Metro area)
    Thanks for your help!

    Since it wouldn't be entirely fair to charge for the time due to equipment to some degree, I have found that if I charge an average for encoding at a certain quality for so many minutes of film that would be more fair. For instance I would charge maybe .50 a min for a high quality compressed file. The idea isn't the price's I'm giving but rather a structured way to think of how to charge the customer. You're in an area that could charge more depending on the client and the availability of your serivces for a given price. Come up with things per hour and things per minute of film for the type of service you'll be rendering.

  • Dunno how to write JSP for login in......

    Can someone help mi on write JSP coding for login in page?i dun really know how how to write JSP coding. i m now doing a project on Private Driving instructor portal where people can register as trainee or instructor.now i want to write the JSP coding on the login page part.... when instuctor login it will go to a instructor's main page n if a trainee login it will go to a trainee's main page.Can someone help mi on this??? it's very urgent n important for mi.Please help mi.

    The easiest method I have found is to use a database to store the users details along with a flag indicating whether they are a trainee or an instructor. Upon logging in, you can use a bean to connect to the database and retrieve these values, then it is a simple matter of a jsp:forward tag to re-direct to the applicable page for trainee or instructor ...
    e.g.
    <pre>
    ***JSP PAGE ***
    <%@page language="java" buffer="32kb" import="jspclasses.customer.*" errorPage="./error.jsp"%>
    <jsp:useBean id="userBean" class="jspclasses.userInfoBean" scope="session"/>
    * Get user and pass from form variables. (if passed)*
    String user = request.getParameter("username");
    String pass = request.getParameter("password");
    * Retrieve fullname from session object. (if exists)*
    fullname = (String)session.getValue("fullname");
    String fwdPage = (String)session.getValue("fwdPage");
    if (fullname==null) {
         try {
         * If no session has been established then attempt to create one using *
         * the values passed through via form. If no values have been passed *
         * through then variables will equal null as opposed to empty strings. *
         * If null is evident, catch with NullPointerException. *
              if (user.equals("") || pass.equals("")) {
                   fullname = "Not";
              } else {
                   * Send values to method which validates users *
                   userBean.setUserInfo(user,pass);
                   * If an error was encountered within userBean the error *
                   * instance variable will != null. *
                   if (userBean.error == "") {
                        fullname = userBean.getFullname();
                   } else {
                        * Error was encountered so we set fullname to "Not", if *
                        * user was entered we re-display value and we instantiate *
                        * error variable to error value of userBean. *
                        fullname = "Not";
                        if (user!=null) uservalue=user;
                        error = userBean.error;
                        //out.println("Error is not null:<br>"+error+"<br>");
                   if (fullname!="Not") {
                        session = request.getSession(true);
                        session.putValue("fullname",fullname);
                        session.putValue("email",user);
                        session.putValue("user_id",userBean.getUserId());
                        session.putValue("user_type",userBean.getUserType());
                        session.putValue("sessionid",session.getId());
                        session.setMaxInactiveInterval(12000);
    ***END JSP***
    *** START BEAN ***
    public void setUserInfo(String user, String pass) {
    String stmtString = "";
    ResultSet rs = null;
    // Check to see if a valid connection is available
    getConnection();
    // If getConnection returns null then
    // connection successfully established
    if (error.equals("")) {
    try {
    // Create SQL string to be sent to database
    stmtString = "select * from serv_user where email = '" + user + "' and password = '" + pass + "'";
    // Execute SQL
    rs = stmt.executeQuery(stmtString);
    // Specify estimated rows to be returned
    rs.setFetchSize(1);
    // If a row is returned get first and last name
    if (rs.next()) {
    user_id = ((rs.getString("USER_ID")!=null)?rs.getString("USER_ID"):"");
    ("USER_TYPE_ID"):"");
    first_name = ((rs.getString("FIRST_NAME")!=null)?rs.getString("FIRST_NAME"):"");
    last_name = ((rs.getString("LAST_NAME")!=null)?rs.getString("LAST_NAME"):"");
    business = ((rs.getString("BUSINESS_NAME")!=null)?rs.getString("BUSINESS_NAME"):"");
    address = ((rs.getString("ADDRESS")!=null)?rs.getString("ADDRESS"):"");
    suburb = ((rs.getString("SUBURB")!=null)?rs.getString("SUBURB"):"");
    state = ((rs.getString("STATE")!=null)?rs.getString("STATE"):"");
    postcode = ((rs.getString("POSTCODE")!=null)?rs.getString("POSTCODE"):"");
    hom_phone = ((rs.getString("HOM_PHONE")!=null)?rs.getString("HOM_PHONE"):"");
    bus_phone = ((rs.getString("BUS_PHONE")!=null)?rs.getString("BUS_PHONE"):"");
    mob_phone = ((rs.getString("MOB_PHONE")!=null)?rs.getString("MOB_PHONE"):"");
    fax = ((rs.getString("FAX")!=null)?rs.getString("FAX"):"");
    email = ((rs.getString("EMAIL")!=null)?rs.getString("EMAIL"):"");
    pass_hint = ((rs.getString("PASSWORD_HINT")!=null)?rs.getString("PASSWORD_HINT"):"");
    else {
    error = "User <b>"+user+"</b> does not exist with specified password.<br>Please try again.";
    } // END : ResultSet = true
    } // END : TRY
    catch (SQLException sqle) {
    error = "<b>Error accessing database:</b><br> "+sqle.toString()+" - ORA:"+sqle.getErrorCode();
    catch (Exception e) {
    error = "<b>Error occurred in method setUserInfo()</b><br> "+e.getMessage();
    } // END : CATCH
    finally{
    closeConnection();
    try{
    rs.close();
    }catch(SQLException sqle){
    } // END : IF
    } // END : METHOD
    } // END : BEAN
    ***END BEAN***

  • How does jmf support for avi format

    I have written code to play audio and video filesusing JMF..My code is able to run only in mp3 and other 2 formats, but it is failed to run other formats like avi, mov etc..Now i need to play my video file which is their in avi format. Please tell me how does my code supports in other formats too...I had searched in google and it has given me some sites, but i didnt get any solution from them.

    Ok, I rant about this same thing again
    AVI is a file format. Think of it like a can. Either you have a can openor or not, but just because you have the ability to open the can doesn't mean you can necessarily eat what's inside.
    AVI is simply a file format that you can embed audio and video data into. The video itself is going to be encoded using some video encoding, like, RGB or DivX or something like that.
    JMF supports the AVI filetype, but it only supports a few video encodings for the AVI.
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html]
    Same with MOV files. Again, a filetype. You need to make sure the encoding inside the file is supported by JMF, otherwise it won't be able to play it.

  • How much to charge for encoding/compressing?

    I'm used to getting materials that are already pre-encoded/compressed from Final Cut Pro to a format I can use in DVD Studio Pro. I've been asked to bid on a project that would be 90-100 minutes in length that would have me do the encoding via Compressor and I'm not quite sure what to charge (as it would take hours and hours to do, I'm not sure my regular hourly rate would be appropriate, but don't want to screw myself out of $$$ either, especially since it would tie up the computer for a while).
    What would be a good rate (I'm in the New York Metro area)
    Thanks for your help!

    Might be a chance to cover the costs of something like Bitvice. Currently the Compressor 2 highest quality settings are not ideal, and Bitvice might do a better job. You could charge them $300 and cover the cost of the program:
    http://www.innobits.se/ssl/phform.php
    Incidentally, there's a company just around the corner from me in SoHo who charge about $100 per hour of footage, so including tapes and everything they would be under $300, and that's for high quality hardware encoding.

  • How to fix " insufficient disk space for encoding" on DVD STUDIO PRO 4

    I keep getting the error message, "insuffiecient disl space for encoding" on DVD STUDIO PRO 4. I  reinstallled the program, uptaded software and also cheked the library receipts file. After the reinstall I am still getting the same message. Can anyone tell me how to fix this?
    Thanks

    Thank you for you help, however I think you misunderstood my question
    I have 800 gb on my Mac hd
    I am getting this error message when I go to build and format the dvd. This is after compression encoding.

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • How to use taglibs in JSP for Database access

    Hi
    Could any one please tell me how to use taglibs in JSP for Database access
    with regrds
    Jojo

    This is a sample how to connect to a MySQL database with JSTL 1.0:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>JSTL MySQL</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <c:catch var="e">
    <sql:setDataSource var="datasource" url="jdbc:mysql://Your_Server_Name_Here/You_Schema_Here"
                           user="Your_Username_Here" password="Your_Password_Here"
                           driver="com.mysql.jdbc.Driver"/>
    <c:out value="datasource= ${datasource},  Class = ${driver.class}"/>
    <br />
    <br />
    <sql:query var="deejays" dataSource="${datasource}">SELECT * FROM Your_Table_Name_Here</sql:query>
    <table>
    <%-- Get the column names for the header of the table --%>
    <c:forEach var="columnName" items="${deejays.columnNames}"><th><c:out value="${columnName}"/></th></c:forEach>
    <tbody>
    <%-- Get the value of each column while iterating over rows --%>
    <c:forEach var="row" items="${deejays.rows}">
      <tr><c:forEach var="column" items="${row}">
            <td><c:out value="${column.value}"/></td>
          </c:forEach>
      </tr>
    </c:forEach>
    </tbody>
    </table>
    </c:catch>
    <br />
    <br />
    <c:if test="${e!=null}"><span class="error">Error</span>�
      <c:out value="${e}" />
    </c:if>
    </body>
    </html>And this thread might help you:
    http://forum.java.sun.com/thread.jspa?threadID=639471&tstart=44

  • How PI handels encoding formats?

    Hello Experts,
    Please help to understand how PI 7.1 treats different encoding formats eg ANSCI ect or how it handels properity chacters coming in messages?
    - Rajan

    Hi,
    in PI in ID in your comm channel, you have a property content encoding where you can specify the characater encoding of your msg being sent or recived by PI.............
    moreover for some adapters you have some module properties in which you can set the character encoding of your msg in PI in ID..........
    Regards,
    Rajeev Gupta

  • How Can i change the Encoding for Mp3 cds???

    I am curious on how i can chane the Encoding With on i tunes.....The reason is im heavily into car audio and always like to see the names of the bands and song title come up when i play them in my car. Ive noticed certain bands show up on the screen of my cd player..but others say no artist. Ive Also noticed some have a different encoding such as Lame 3.96....... Does Anyone Know How to Change the Encoding With....Or Make it Show up on my car cd player?

    Do you mean you'd rather import using say AAC for instance instead of mp3?
    Go to iTunes Preferences (+,)>advanced>importing>import using> change to which ever format you desire.
    When you burn the cd, check "include CD text" under the audio section if you're burning an audio CD.

  • How to tell N6.5 DHCP to use a W2k8 for PXE?

    Hello,
    could anyone give me a hint, how to tell my netware DHCP to use a Windows Server 2008 R2 running Acronis with PXE Server?
    Actual Situation:
    Netware 6.5 Sp8 Server with ZENWORKS in Cluster mode
    Netware DHCP Server
    ZEN7 SP1 Imaging
    --> works fine so far, and no problem in other subnets, IP-helper are configured in the switches
    New Situation:
    Netware 6.5 Sp8 Server with ZENWORKS in Cluster mode
    Netware DHCP Server
    Windows Server 2008 R2 running Acronis Snap Deploy with PXE-Server - in future may be a clean Windows Deployment service without Acronis
    --> that would be nice :)
    I found serveral ini-files (dts.ini, pdhcp.ini, tftp.ini) where I configured the new IP-Address of the W2k8 PXE Server.
    Now:
    The Client gets its correct IP-Address from Netware DHCP
    but after that the following messages:
    Auto-select:
    ZENworks Boot
    Boot Server IP: --.--.--.-- (the correct one configured in the ini-files!)
    TFTP.
    PXE-T02:
    PXE-E3C: TFTP Error - Access Violation
    PXE-M0F: Exiting Intel Boot Agent
    Any ideas?
    Thanks a lot.

    Originally Posted by magic31
    You don't have to configure anything specifically in DHCP to work with PXE. Possibly just unconfigure an option that was set for the previos setup; One thing to check (and remove) is option 60 for the PXE Client option, if this is configured with the DHCP subnet options. This option should only be set if both DHCP and PXE services are on the same server (as is probably the case in your situation as I'm guessing both DHCP as also PXE get loaded in the same cluster resource script).
    For subnets serviced outside of the subnet your DHCP server is running in, you will need to configure multiple ip helpers: one that points to the DHCP server and one points to the PXE server so those requests on other subnets get serviced correctly.
    To get things running it's probably easier to try to get this to work on the subnet your DHCP and PXE server are running in (so you are not also having to deal with the ip helper setup just yet). If that works, then expand you configuration to different subnets & ip helpers.
    Hope that helps,
    Willem
    As a ps and for clarification, don't load the PDHCP on any of the NetWare servers... just have the PXE PDHCP service running on the Windows server.
    The PDHCP/PXE service for ZenWorks won't understand/work with the Arconis one and visa versa.
    -Willem

  • How can I use an external player for MP3 and MP4 fomats without disabling native HTML5 playback support for mpeg formats that are embedded in webpages?

    The Application options were poorly implemented, resulting in multiple instances of handlers for some formats in a long and confusing list. Now Mozilla seems to have solved that problem by preventing users from choosing how various media formats are to be handled -- the cure is worse than the disease! I am getting damned tired of researches into how this or that poor new decision in Firefox's development can be overruled, circumvented, or lived with. How can I choose how an .mp3 file is to be played, and what is going on at Mozilla that I have to ask?

    Right-click the link and choose Save Link As to download the file. Afterwards, click the Downloads button on the navigation toolbar and left-click the downloaded file. This will open it with the associated application.
    * [[Find and manage downloaded files]]
    Setting ''media.windows-media-foundation.play-stand-alone'' to '''false''' in [http://kb.mozillazine.org/About:config about:config] is the only way to prevent files like MP4 and MP3 being played inside the browser when left-clicking the links, until the preferences for handling such files are properly fixed at some point in the future. That will happen whenever a developer finds the time to write a patch.

  • I am trying to download a free trial of photoshop for my macbook pro and it says there is an error and that the requirements for the new version is not supported for the mac I have. I have looked at the list of requirements but have no idea how to tell wh

    I am trying to download a free trial of photoshop for my macbook pro and it says there is an error and that the requirements for the new version is not supported for the mac I have. I have looked at the list of requirements but have no idea how to tell what I do and do not have?

    Apple Menu --> About this Mac.
    Mylenium

  • I am trying to burn a dvd and it will not allow me to do this because it states that i do not have enough space for encoding disk. how do i free up space and from where?

    I am trying to burn a dvd and it will not allow me to do this because it states I do not have enough space for encoding. how do i free up space and from where?

    iDVD can only use your startup hard disk for the "scratch space" it needs for calculations during the encoding process.  25 GB is a good average requirement, but a large project (3 or 4 hours of content) might require more.
    To free up space, you will have to move items to an external hard drive and/or delete items you no longer want.
    Please note that iDVD can't use and external hard drive for this "scratch space".

Maybe you are looking for

  • Discoverer Report Ownership and Exports

    We are currently upgrading to R12 from 11.5.10 and I'm looking to migrate discoverer with it. The environment and set up of disco has been completed however there are a few issues around migrating the existing reports and EUL I'm not sure about. I wo

  • Is there a way you can add elements dynamically to an existing array??

    hey guys... i need to add elements to an array dynamically... how do i do that? for example... in one of my functions i do..      for each(var item:Object in fileList){           fileListArr.push(item); and in a later function i need to add one more

  • Upgraded from QuickTime 5 to 7.1.6 & to 7.65.17.80  All QT mov are garbled

    Upgraded from QT 5 to 7.1.6 Movies that played on ver 5 were now all garbled so. . up graded to ver 7.65 and still all movies are garbled. Reinstalled Win XP hoping that there were sme missing dlls that might fix this, but no go all mov files are jus

  • Flash Lite - what phones & network

    I have been trying to get a straight answer on what phones work with Flash Lite in the US today. I heard that Verizon supports Flash Lite (or will?) but their website has absolutely no mention of Flash Lite. I read some articles about some phones tha

  • I just sent back my zen touch...what can I expe

    After sending my zen touch back when can I expect to get it's I don't really want a generic answer here. I dont want the creative answer but I would like to hear maybe from someone else who has had to send theirs back. I also have 2 other questions i