JSP Japanese String problem

Hi,
I have to load a web page which contains japanese strings.
The Japanese strings contain some escape characters in between in the Java code . The java code is inserted in the jsp file.
when I load the jsp file, Japanese characters are played on browser in unicode format. is not able to display properly on the web page.
It displayed something like this : "?�???c?[?????g?p?????????A?�?[?U?[?????"
I have used japanese strings of Unicode format.
I am using IBM Websphere..
Is there any seeting to be done inorder to show the Japanese strings properly ?
I have already intalled the japanese language pack on my system... even I selected the japanese language option for the browser also...
Can anybody help ?

Hi,
I got the solution anyway...
Character set should be shift_jis
We need to use unicode formatted japanese strings...
To display properly they should be in decimal format...
thanx for your input
regards
sala raja sekhar

Similar Messages

  • Japanese Encoding Problem on iOS

    Hi, Did anyone ever use Mobage Japanese plugin for Unity ios? I am building Unity iOS game for Mobage platform. There is a method (MobageJPService.shareMessage (message, title, pictureUrl, dismissCB)) to share message to iOS e-mail, twitter and Line, but when I pass Japanese strings, but it shows up with lots of question marks. Any solutions or suggestions?

    If you are using third party tools, you will have to ask them for support. It is very unlikely that anyone here knows anything about them.

  • Japanese font problem fixed.

    The Japanese font problem was fixed in the recent update. The Kaku Gothic font now shows in the correct font-weight.
    Only Kaku Std which is a fat font is still a bit fat, but that's how it is.
    http://web.me.com/heli1/Test/Experiment.html
    (the first three danger signs have been fixed)

    where exactly u r using the japenese charecters??
    r u using inthe Java programme or r u using in html page.

  • Unable to print Japanese string...

    Hi,
    I have written a java code in which i am giving input as one Japanese string.
    I need to write it to a file and also have to find its length (Length as a normal single byte string).
    But i getting output as ?????? in place of Japanese string.
    Also when i close and reopen the java file in Jdev, Japanese string gets replaced by ????????.
    I need help on this as what correct charset will be in this case and if any other language specific settings we need to do.
    Thanks

    <%@page pageEncoding="Shift_JIS"%>
    <%@page contentType="text/html; charset=Shift_JIS"%>
    <%request.setCharacterEncoding("Shift_JIS");%>
    <head>
    <META http-equiv="Content-Type" content="text/html;charset=Shift_JIS">
    </head>

  • Comparing Japanese Strings

    I am using String .equals method to compare two japanese strings, but it is returning false even though the strings are equal, but it returns true if the strings are english.
    Do i have to do something special to compare japanese strings?

    Sorry, i am using UTF-8 encoding, i tried ISO-8859-1 but it didnt worked.
    I am using
    BufferedReader rdr =
             new BufferedReader(
                 new InputStreamReader(new FileInputStream("abc.csv"),"UTF-8"));
    String line=rdr.readLine();
    String tempArray[] = line.split(",");
    System.out.println(xlsobj.Headers.containsKey(tempArray[0]);Headers is a HashMap which contains the japanese string which i want to compare.
    I tried to use equals() method in my effort to debug but it is also returning false.

  • Null String and Empty String problem

    Hello everyone,
    since i am totally new in JSP, i am getting problem in handling strings.
    Suppose i have a variable users = ""; then
    I want to ask when to use:
    if (users.equals(""))
    and
    if(users == "")
    in my code, variable users has value "regional" for regional users.
    and i am checking this code as:
    if (users.equals{"regional")) {
    out.print ("I am inside code");
    at that time, the code is throwing error (run time error)
    and when i changed the code as:
    if (users == "regional") {
    out.print ("I am inside code");
    this time, the code is not generating error but the part message "I am inside code " is not displaying. The code do not inserts inside the if condition
    I hope u understand my problem. Can anybody help me out with this.

    This has basically nothing to do with JSP, but with basic Java knowledge.
    When using the '==' operator to compare Objects (yes, String is actually a subclass of Object), then it will look if they are of the same reference. Using the '==' operator to compare primitive datatypes (int, boolean, char, etc) will look if they have the same value.
    That is why the Object class has the equals() method to give the ability compare with another objects. And you can only invoke it when the Object is actually instantiated. So if it is not null.
    if (string != null && string.equals("somevalue")) {
    // or
    if ("somevalue".equals(string)) {
    }should work.
    Edit rym82: this will not throw a NPE, but an ordinary compilation error ;)
    Message was edited by:
    BalusC

  • Japanese Display problem in Turbo Linux8.0 and Redhat Linux7.1

    Hello Experts
    My Problem is
    Font my_Font=new Font(Dialog , 0 , 12) is displaying japanese chatacters properly in windows 2000 , J2SDK1.4.1
    when i run the program in Turbo Linux8.0 , Redhat Linux 7.1
    Dialog font displays japanese as junk characters.
    Please help me to solve the problem
    J2SDK instllation version is j2sdk-1_4_1_01-linux-i586.
    Thanks in Advance
    Anji
    My Program is
    =================
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    public class FontFrame extends JFrame
         String[] Fonts=null;
         String display="Text";
         public FontFrame()
              Fonts=getFontNames();
              setSize(600,800);
              repaint();
         public String[] getFontNames()
              GraphicsEnvironment gd=GraphicsEnvironment.getLocalGraphicsEnvironment();
              String fontFamily[]=gd.getAvailableFontFamilyNames();
              System.out.println("/******Font Family in System*********/");
              return fontFamily;
         public void paint(Graphics g)
              //super.paint();
              //System.out.println("OK:");
              int x=50;
              int y=60;
              for(int i=0 ; i<Fonts.length ; i++)
                   Font f= new Font(Fonts[i] , 0 , 12);
                        g.setFont(f);
                   g.drawString(Fonts[i]+"->���������V�X�e���P", x , y);
                   x=x+200;
                   if(x>600)
                        x=50;y=y+30;
         public static void main(String[] args)
              FontFrame ff= new FontFrame();
                   ff.setVisible(true);

    You can use unicode escape sequences of the form
    "->\u682a\u5f0f\u4f1a\u793e\u30b7\u30b9\u30c6\u30e0\u30b1"or the option
    -encoding <encoding>  //encoding is for source file encodingfor javac command.

  • Japanese Character Problem Yet Again!!

    Hi,
    While trying to run a query( containing Japanese characters ) through my java code, I get the following SQLException:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string '[email protected]'.
    However if I run the same query through the SQL Query Interfcae manager, it runs just fine.
    I am attaching the query too.
    Insert into Registration(nvchCustomerID,dtCreationDate,nvchLoginID,nvchPassword,nvchRemindQuestion,nvchOtherRemindQuestion, nvchRemindAnswer,intReceiveEmail,nvchEmailAddress) values('NI200205010001','20020501','ydipak','ydipak','���l������','null','ydipak',1,'[email protected]');
    Any help in this direction would be greatly appreciated.
    Thanks and Regards

    Thw simplest solution to this problem is to use PreparedStatement.
    prepare a statement like insert into table values(?,?,?,?,?)
    and use bind variables like
    pstmt.setString(1,"���l������")
    pstmt.setString(2,"���l������")
    etc...
    saifuddin

  • JSP + JDBC + MySql Problem (Tomcat 4.1)

    I'm completely helpless... whenever I try to retrieve stuff from the db (using a jsp page), I get errors that don't even make sense.
    out.println(stmt.executeQuery("SELECT * FROM newsTbl WHERE articleID = 1").getString("articleTitle"));if I try doing the above, I get a "ServletException : Before start of result set" error that supposedly occurred at this line of the generated servlet:
    if (pageContext != null) pageContext.handlePageException(t);---------------
    If i try this:
    ResultSet rsSec = stmt.executeQuery("SELECT * FROM newsSecTbl");
    rsSec.beforeFirst();  //<-- Even if I don't have this line the result does not change
      out.println(rsSec.next());
      while (rsSec.next()) { ... }I the while loop is never initiated, because rsSec.next() is false... kind of weird if you ask me, I even put two entries into the table to make sure the cursor wasnt at the first record and saying there was no second one (which would have been right if there were only one record).
    I would be very grateful if someone could help me out with this. I've never done any db programming with Java yet, so I dont have a clue what Im doing. By the way, I'm using MySql (indicated in the title) and the server was running and available when I ran the above code.
    Cheers,
    Tom

    You can't do this:
    out.println(stmt.executeQuery("SELECT * FROM newsTbl WHERE articleID = 1").getString("articleTitle"));The ResultSet you get back is a database cursor that doesn't point to the first row yet. The correct idiom is:
    String sql = "SELECT * FROM newsTbl WHERE articleID = 1";
    ResultSet result = stmt.executeQuery(sql);
    String articleTitle = "";
    while (result.next())
       title = result.getString("articleTitle");
    result.close();
    stmt.close();If you've never done DB programming before, I'd recommend that you click on the Tutorials link to the left and go through the JDBC tutorial carefully. You'll save yourself a lot of grief.
    Another good idea would be to separate out all your database code into at least one separate object, independent of the servlet. That way you can test and develop it off to the side until it's 100% solid. Then your servlet can simply instantiate one and use it. All your problems from that point forward will be servlet issues, because you'll know that your database code is working. - MOD
    See if that works better. - MOD

  • Jsp-servlet-bean problem

    Please help!
    I have a servlet controller, a javabean for the data and a jsp for the view.
    I cannot get the jsp using
    <jsp:useBean id="pList" class="bbs.PostListCommand" scope="request" />
    to access the bean data
    However, when I access the bean in this way
    <%@ page import="bbs.PostListCommand" %>
    // html
    <% bbs.PostListCommand postList = null;
    synchronized(session){
         postList = (bbs.PostListCommand) session.getAttribute("PostListCommand");
         if (postList == null){ %>
              <H1>Nothing in request scope to retrieve ....</H1>
              <P>
    <%     }
         else{  %>
              <TABLE border="1">
    // etc
    � it works
    Does anyone know why the <jsp:useBean> tag does not find the bean
    I have installed tomcat 4.18 and set the environmental variables etc.
    Directory structure is
    E:\Tomcat41\webapps\examples\WEB-INF\jsp          for jsp�s
    E:\Tomcat41\webapps\examples\WEB-INF\classes\bbs     for bean and servlets
    Thanks in advance for any help.
    Chris

    GrayMan - Thanks for your help.
    Let me explain my problem in more detail ...
    Background:
    I have some servlet experience, but I am new to jsp - so sorry if this seems trivial to you ...
    I have a book called bitter java by bruce tate from manning.com . I am trying to get the chapter 3 examples to work
    There are three files
    PostListCommand          the bean
    PostListController     the servlet
    PostListResults          jsp
    And a new test file � PostListResults version 2 with scriptlet code to access the bean.
    There are a couple of typos in the downloaded source files, but nothing that causes the main problem of not being able to access the bean data.
    Program flow
    Servlet instantiates new bean
    Bean � gets data from db
    Servlet passes bean to jsp with a forward
    Jsp outputs data
    I have put the files in the directories �
    E:\Tomcat41\webapps\examples\WEB-INF\jsp          for jsp�s
    E:\Tomcat41\webapps\examples\WEB-INF\classes\bbs     for bean and servlets
    The complete source code for each file is given below.
    1 I have checked the db access � that�s ok
    2 I have also checked reading the bean data back in from the request scope and printing out the results from within the servlet.- ok
    3 I can access the data through a scriptlet (PostListResults version 2), but not with the original PostListResults which uses <jsp:useBean>
    thanks in advance, chris
    PostListController.java
    package bbs;
    // Imports
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    // Import for commands used by this class
    import bbs.PostListCommand;
    public class PostListController
    extends javax.servlet.http.HttpServlet
    implements Serializable {
    * DoGet
    * Pass get requests through to PerformTask
    public void doGet(
    HttpServletRequest request,
    HttpServletResponse response)
    throws javax.servlet.ServletException, java.io.IOException {
    performTask(request, response);
    public void performTask(
    HttpServletRequest request,
    HttpServletResponse response) {
    try {
    PostListCommand postList = (bbs.PostListCommand) java.beans.Beans.instantiate(getClass().getClassLoader(),"bbs.PostListCommand");
    postList.initialize();
    postList.execute();
    request.setAttribute("PostListCommand", postList);
    ServletContext sc = this.getServletContext();
    RequestDispatcher rd =
    sc.getRequestDispatcher("/jsp/PostListResults.jsp");
    rd.forward(request, response);
    } catch (Throwable theException) {
    theException.printStackTrace();
    PostListCommand.java
    package bbs;
    import java.io.*;
    import java.sql.*;
    //import COM.ibm.db2.jdbc.*;
    import java.util.*;
    * Insert the type's description here.
    * Creation date: (07/17/2001 5:07:55 PM)
    * @author: Administrator
    public class PostListCommand {
    // Field indexes for command properties     
    private static final int SUBJECT_COLUMN = 1;
    private static final int AUTHOR_COLUMN = 2;
    private static final int BOARD_COLUMN = 3;
    protected Vector author = new Vector();
    protected Vector subject = new Vector();
    protected Vector board = new Vector();
    // SQL result set
    protected ResultSet result;
    protected Connection connection = null;
    * execute
    * This is the work horse method for the command.
    * It will execute the query and get the result set.
    public void execute()
    throws
    java.lang.Exception,
    java.io.IOException {
    try {
    // retrieve data from the database
    Statement statement = connection.createStatement();
    result =
    statement.executeQuery("SELECT subject, author, board from posts");
    while (result.next()) {
    subject.addElement(result.getString(SUBJECT_COLUMN));
    author.addElement(result.getString(AUTHOR_COLUMN));
    board.addElement(result.getString(BOARD_COLUMN));
    result.close();
    statement.close();
    } catch (Throwable theException) {
    theException.printStackTrace();
    * getAuthor
    * This method will get the author property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getAuthor(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) author.elementAt(index);
    * getBoard
    * This method will get the board property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getBoard(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) board.elementAt(index);
    * getSubject
    * This method will get the subject property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getSubject(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) subject.elementAt(index);
    * initialize
    * This method will connect to the database.
    public void initialize()
    throws java.io.IOException {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    // URL is jdbc:db2:dbname
    String url = "jdbc:db2:board";
    // URL is jdbc:odbc:bitter3board
    String url = "jdbc:odbc:bitter3board";
    // connect with default id/password
    connection = DriverManager.getConnection(url);
    } catch (Throwable theException) {
    theException.printStackTrace();
    * Insert the method's description here.
    * Creation date: (07/17/2001 11:38:44 PM)
    * @return int
    * @exception java.lang.IndexOutOfBoundsException The exception description.
    public int getSize() {
    return author.size();
    PostListResults.jsp
    <HTML>
    <HEAD>
    <TITLE>Message Board Posts</TITLE>
    </HEAD>
    <BODY BGCOLOR=#C0C0C0>
    <H1>All Messages</H1>
    <P>
    <jsp:useBean id="postList" class="bbs.PostListCommand" scope="request"></jsp:useBean>
    <TABLE border="1">
    <TR>
    <TD>Subject</TD>
    <TD>Author</TD>
    <TD>Board</TD>
    </TR>
    <% for (int i=0; i < postList.getSize(); _i++) { %>
    <TR> <TD><%=postList.getSubject(_i) %></TD>
    <TD><%=postList.getAuthor(_i) %></TD>
    <TD><%=postList.getBoard(_i) %></TD>
    </TR>
    <% } %>
    </TABLE>
    <P>
    </BODY>
    </HTML>
    PostListResults.jsp version 2 � with scriplet code instead of useBean
    <HTML>
    <%@ page import="bbs.PostListCommand" %>
    <!-- This file was generated by the chris -->
    <HEAD>
    <TITLE>Message Board Posts</TITLE>
    </HEAD>
    <BODY BGCOLOR=#C0C0C0>
    <% bbs.PostListCommand postList = null;
    synchronized(request){
         postList = (bbs.PostListCommand) request.getAttribute("PostListCommand");
         if (postList == null){ %>
              <H1>Nothing in request scope to retrieve ....</H1>
              <P>
    <%     }
         else{  %>
              <TABLE border="1">
              <TR>
              <TD>Subject</TD>
              <TD>Author</TD>
              <TD>Board</TD>
              </TR>
         <% for (int i=0; i < postList.getSize(); _i++) { %>
                   <TR> <TD><%=postList.getSubject(_i) %></TD>
              <TD><%=postList.getAuthor(_i) %></TD>
              <TD><%=postList.getBoard(_i) %></TD>
              </TR>
         <% } %>
              </TABLE>
    <%     }
    }%>
    <P>
    goodnight
    </BODY>
    </HTML>

  • Jsp file download problem

    Hi,
    I am using following code in jsp.
    <%@ page session="true"%>
    <%@ page import="java.io.*" %>
    <%
    String fileName="test.txt";
    response.setContentType("application/txt");
    response.setHeader("Content-Disposition","attachment; filename="+fileName);
    try
    PrintWriter fw = response.getWriter();
    fw.write("param1");
    fw.write(",");
    fw.write("param2");
    fw.write(",");
    fw.write("param3");
    fw.write("\r\n");
    fw.flush();
    fw.close();
    catch(Exception e)
    %>
    <input type=button value="CONTINUE">
    The problem is flow does not go to CONTINUE button and it lost the control after response.setHeader("Content-Disposition","attachment; filename="+fileName);
    Do you have any idea what is the problem ?
    Thanks

    Hi
    I am trying to give user option so that he can download a file in his local machine.
    As you suggest use out object. I used the out object but i still have the same problem.
    After writig in a data.csv file, control does not go to the CONTINUE button.
    following is the sample code which i am using.
    <html>
    <body>
    <%
    String file="data.csv";
    //response.setContentType("application/vnd.ms-excel");
    response.setContentType("application/html");
    response.setHeader("Content-Disposition","attachment; filename="+file);
    try
    out.write("Test1");
    catch(Exception e)
    %>
    <div align="right">
    <input type=button value="CONTINUE">
    </div>
    </body>
    </html>
    do you have any suggestion to fix this problem?
    Kind Regards

  • JSP Mysql Connection Problem

    Hi Friend,
    I am facing some problem in connecting mysql with jsp .
    When I try and connect to mysql with the following connection string
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/testdhiraj?user=root&password=dh");
    Statement statement     = con.createStatement();
    I get an error :
    java.sql.SQLException: Communication link failure: Bad handshake
    I don't know what is wrong,
    as I had tested mysql using telnet and it connects and executes sql nicely.
    Waiting for ur reply,
    Dhiraj Agrawal
    mail to : [email protected]

    Hi,
    You need to make sure that , you have given correct database name, user id and password in the connection url. and also check the jdbc driver is loaded properly. If your mysql is running in the standard port, you need not give the port as 3306.
    Here is the example :
    import java.sql.*;
         Notice, do not import org.gjt.mm.mysql.*
    or you will have problems!
    public class XampleClass
    public static void main(String[] Args)
    try {      
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    catch (Exception e) {
    System.err.println("exception while loading
    driver.");
    e.printStackTrace();
    try {
    Connection C = DriverManager.getConnection(
    "jdbc:mysql://localhost/test?user=myuser&password=mypwddb");
    // Do something with the Connection
    catch (SQLException e) {
    System.out.println("Exception: " + e);
    This is the format for conenction url :
    jdbc:mysql://[hostname][:port]/dbname[?param1=value1][&param2=value2]...
    Hope this helps you.
    Thanks,
    Senthil_Slash

  • JSP Shopping Cart problem

    Hello,
    I'm writing a JSP page with a shopping cart so the user can add products to it, nfortunately the thing won't work.. I keep getting an NullPointerException.. I'm probably screwing up somewhere.. I would be very thankful if you could help me out..
    this is the code for the Shopping Cart Bean:
    [myCart.java]
    package myCart;
    import java.util.*;
    public class myCart implements java.io.Serializable{
         private Vector items;
    public String[] getItems(){
         String strTemp[] = new String[items.size()];
         items.copyInto(strTemp);
         return strTemp;
    public void setItems(Vector newItems){
         items=newItems;
    public void addItem(String newId){
         items.addElement(newId);
    This is the JSP page that I'm using:
    [myCart.jsp]
    <%@ page import="java.sql.*" %>
    <%@ page import="java.util.*" %>
    <jsp:useBean id="myCart" class="myCart.myCart" scope="session" />
    <%
    Connection con;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:produkten");
    Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery("SELECT * FROM tblProdukten WHERE NR= "+request.getParameter("nr")+"");
    while (rs.next()) {
         String merk = rs.getString("MERK");
         long temp = rs.getLong("NR");
         String nr = Long.toString(temp);
    -----> myCart.addItem(nr);
         %>
         <BR>Nr     : <%=nr%>
         <BR>test :     <%=merk%>
         <HR>
    <% } %>
    <%
         con.close();
         catch(ClassNotFoundException cnfex)
              out.println("jdbc odbc driver not found // muzz");
         catch(SQLException sqlex)     
              out.println(sqlex);
    %>
    </TABLE>
    </BODY>
    </HTML>
    I think I probably(??) put the <myCart.addItem> in the wrong part of the code..??
    Greetings,
    Michael

    yes, I see, I forgot to initiate that, I'm still
    learning so please bare with me :)
    I now initiated the <items> vector like this:
    Vector items = new Vector();
    and added this:
    myCart.items.addItem(nr);
    But it still won't work correctly >>
    First error: Your Vector items is not a public variable. Therefore, outside classes will not be able to access it. No problem though, you have a method to take care of that. Instead of what you're doing, simply call
    myCart.addItem(nr)This calls the public method addItem(String) which accesses your private Vector items, and adds a string to the vector.
    Your second error should be taken care of. It is resulting from the fact that instead of calling the method addItem() from teh class instance, youre trying to access the Vector items first, and then trying to call addItem() from that... not only can you not access that variable, as stated above, but there is no method in Vector called addItems(). You could conceivably make items public, but I'd stick with what you've got.

  • JSP, Javabean charset problem

    I have some JSP pages where I try to dynamically present some drop-down
    menus for the users to select values. I use a simple bean to manage it.
    The problem is that those values are in non-iso8859-1 charset and I only
    get ?????? rendered in the select box. I define an array (inline in the
    JSP page as code scriptlet), write all possible (String) options for the
    drop-down menu there and in the bean I do some calculations and render
    the drop-down menu.
    String label[]={"something in iso-8859-7 encoding in here","something in
    iso-8859-7 encoding in here","something in iso-8859-7 encoding in here"};
    and in the bean I have a for-loop to access this.
    The page directive is set to iso-8859-7.
    I think there is some kind of transparent translation, that has to do
    with Java language, and after the rendering I only get ???? instead of
    the correct iso-8859-7 value in the browser.
    Any help appreciated.
    (Tomcat, Apache web server, JDK 1.3,)
    PS: This JSP page is used to submit some data in an Oracle database
    (according to the selection of the user in the drop-down box), so I also
    use JDBC 1.3, but I don't think that's relevant at all with my problem...
    null

    I have some JSP pages where I try to dynamically present some drop-down
    menus for the users to select values. I use a simple bean to manage it.
    The problem is that those values are in non-iso8859-1 charset and I only
    get ?????? rendered in the select box. I define an array (inline in the
    JSP page as code scriptlet), write all possible (String) options for the
    drop-down menu there and in the bean I do some calculations and render
    the drop-down menu.
    String label[]={"something in iso-8859-7 encoding in here","something in
    iso-8859-7 encoding in here","something in iso-8859-7 encoding in here"};
    and in the bean I have a for-loop to access this.
    The page directive is set to iso-8859-7.
    I think there is some kind of transparent translation, that has to do
    with Java language, and after the rendering I only get ???? instead of
    the correct iso-8859-7 value in the browser.
    Any help appreciated.
    (Tomcat, Apache web server, JDK 1.3,)
    PS: This JSP page is used to submit some data in an Oracle database
    (according to the selection of the user in the drop-down box), so I also
    use JDBC 1.3, but I don't think that's relevant at all with my problem...
    null

  • JSP Error Message Problem

    I keep getting the following error message when I click login on my sample login page:
    Error: 500
    Location: /examples/jsp/gcdBB/Login.jsp
    Internal Servlet Error:
    javax.servlet.ServletException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near '"USERNAME", "PASSWORD") VALUES ('admin','admin')' at line 1"
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:386)
         at jsp.gcdBB._0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6._jspService(_0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6.java:97)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
         at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
         at java.lang.Thread.run(Unknown Source)
    Root cause:
    java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax near '"USERNAME", "PASSWORD") VALUES ('admin','admin')' at line 1"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1628)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
         at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:917)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:1806)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:1740)
         at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1309)
         at jsp.gcdBB._0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6._jspService(_0002fjsp_0002fgcdBB_0002fLogin_0002ejspLogin_jsp_6.java:87)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:174)
         at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
         at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
         at java.lang.Thread.run(Unknown Source)
    How can i solve this error?

    Here is the section of code in question:
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    java.sql.Connection connection=java.sql.DriverManager.getConnection
    ("jdbc:mysql://localhost:8080/gcdBB_db");
    java.sql.Statement statement = connection.createStatement();
    Enumeration parameters = request.getParameterNames();
    if(parameters.hasMoreElements())
    String usernameValue = request.getParameter("username");
    String passwordValue = request.getParameter("password");
    statement.executeUpdate("INSERT INTO USERS (\"USERNAME\", \"PASSWORD\") VALUES ('"+usernameValue+"','"+passwordValue+"')");
    %>
    Any ideas to solving the problem?

Maybe you are looking for