JSP + MySQL + Linux + Tomcat4.1 Chinese display problem

Hello all!
I have a problem to use JSP to display Chinese which is read from MySQL database. It works well under Windows XP. But when I move the code to Linux. The Chinese can't be displayed any more.
The only way to display Chinese correctly is to remove <%@ page contentType="text/html; charset=Big5" %>. This requires to set the browser encoding manually every time, which is not what I want.
I am not sure if I need store the Chinese as Big5 or other unicode in MySQL. Right now, I just insert it into database directly without specifying the characters set.
I have been searching for solutions for quite a while and can't get the answer. Please help me to conquer this problem!
Below is the simplified version of my code:
<html>
<head>
<%@ page contentType="text/html; charset=Big5" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="ConnectionPool.*" %>
<%@ page session="true" %>
</head>
<body>
<table>                    
<%
ServletContext context = getServletContext();
ConnectionPool connectionPool = (ConnectionPool)context.getAttribute("ConnectionPool");
Connection connection = connectionPool.getConnection();
Statement statement = connection.createStatement();
String sqlCmd = "SELECT chinese_word FROM word";     
String chinese_word;
ResultSet rs = statement.executeQuery(sqlCmd);
while (rs.next())
     chinese_word = rs.getString("chinese_word ");               
     out.println("<tr><td>" + chinese_word );
     out.println("</td></tr>");
connectionPool.free(connection);
%>
</table>
</body>
</html>
Thanks a bunch,
Sophie

hi
i am india so no much command on chiness, but, as a solution process , i suggest this
in jsp, response is the default object, so, whereever u want chiness char, use
response.setContentType("text/html; charset=Big5");
and again swith to normal english mode
hope it proceeds...
pranav

Similar Messages

  • UTF8 and Traditional chinese display problem

    I have having problems displaying chinese because I am trying to pull data from 2 difference sources into a 3rd source.
    Question 1
    I am using Oracle 8.17 on Sun Solaris - (in China).
    The NLS_LANG on that machine (Machine name is CNCIM) is American. The NLS_CHARACTERSET is ZHS16GBK.
    We are using Java to write data into this server. The data has been stored as UTF8.
    When I use TOAD, to look at the chinese characters, I cannot see the actual characters.
    What I see in TOAD is something like this
    &#19978;&#28023;&#24066;&#23665;&#19996;&#20013;&#36335;145&#21495;
    Convert function does not seem to work. Can someone advice me how I can see the raw data in chinese?
    Question 2
    Currently, I am also trying to import the above UTF8 data into my Local Oracle Machine (APDM)
    The NLS_LANG on that machine is American. The NLS_CHARACTERSET is WE8ISO8859P1.
    And at the sametime, I am trying to import information from SQL2000 into Local Oracle Machine (APDM).
    I was told that the data in SQL2000 has been setup as tradtional Chinese.
    What type of settings should I have on my local machine(APDM) to allow me to view Chinese data (From CNCIM - UTF8) and to see the SQL2000(traditional chinese) data at the same time? Should this settings
    be configured for my client too?

    My hunch is that Toad either does not support the display of Chinese characters, at least not without setting your Windows regional settings to Chinese. Can you retrieve the data via your Java application?
    If your database character set is ZHS16GBK, that should be the character set that the data is stored in the database. If your Java application is sending over UTF-8 encoded data, you need to ensure that the NLS_LANG settings on the client machine identify the data as UTF-8 so that Oracle can do the necessary character set conversion.
    If your local database is using the ISO 8859-1 character set, it cannot store Chinese data. You would need to create a new database with a character set that supports Chinese if you wanted to store Chinese data there.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Chinese display problem

    When I write data in Chinese into my SQL database,and then read it,but it didn't display correctly,for you see,I use many method,but failed,Who can help me?

    give me some of ur code.
    i do research on it . may be i can help u.
    be care that .
    the encoding type of jdbc connection may be variable according to your systems default language.
    however u can specify certain encoding type in connection url.
    redbeebird

  • PHP MySQL data display problem

    I am having trouble getting data to display on my web page.In Dreamweaver CS3, I created a new page.
    Selected PHP as the type.
    Saved it.
    Connected a database and created a recordset (all using Dreamweavers menus. I did not write any code).
    NOTE: The database is on a remote server.
    The TEST button displayed the records from the recordset with no problem.
    On the new page, I then typed some text.
    Then dragged some fields from the Bindings tab to the page.
    I saved it and then went to preview it in my browser.
    The page comes up completely blank. Not even the text shows.
    I then saved the page as an HTML page.
    When I preview this in my browser, the text shows, but the fields and data do not.
    I then tried creating a dynamic table (again, using the Dreamweaver menus.).
    A similar thing happens, ie. If I save it as an HTML, the text shows and the column labels and border shows, but no data.
    Nothing shows if I save it as a PHP file.
    I can view the data online using files created by PHPMagic, so I know the data is there and retrievable.
    It is just in pages created in Dreamweaver that don’t work.
    What am I doing wrong?

    My web server supports PHP. I can disply PHP pages created by other software packages, just not the Dreamweaver ones.
    Frank
    Date: Thu, 4 Jun 2009 19:04:03 -0600
    From: [email protected]
    To: [email protected]
    Subject: PHP MySQL data display problem
    To view php pages - or pages with PHP code in them - in a browser, the page must be served up by a Web server that supports PHP. You can set up a testing server on your local machine for this purpose. Look for WAMP (Windows), MAMP (Mac), or XXAMP for some easily installed packages.
    Mark A. Boyd
    Keep-On-Learnin'
    This message was processed and edited by Jive.
    It shall not be considered an accurate representation of my words.
    It might not even have been intended as a reply to your message.
    >

  • JSP - MySQL - MS Access

    I have a set of tables in MS Access database and MySQL database.
    My jsp application is running with the help of Apache/Tomcat in Linux box.
    I've the MM.MySQL Driver to integrate MySQL with my application.
    my problem is to know how to communicate jsp with MS Access here.
    I don't know how to connect jsp to MS Access in Linux.
    I searched for solution and finally got an idea of using MyODBC api.
    I need to import data from MS Access to MySQL using MyODBC on Linux.
    Can anyone help me on how to install,configure MyODBC and import data.
    or please pass any reference url.
    or
    please suggest me any solution for this.
    Thanks
    Senthil

    Thats what I meant. If both (Access and MySQL) both run on Windows there should be no problem. But if MySQL is on Linux and Access is on Windows it could be.
    How about setting up Mysql on Windows, going the way magnoli supposed and after that using mysqldump to export zo linux.

  • JSP and Java Beans with Database Problem

    hellow, this is my first posting and i hope to help me as fast as you can...
    my problem is simplly i cant get any data from the database (whatever the database it is, i test it with MS Access and MySQL server) when i use a bean, But if i put my connection statement in the JSP file thair is no problem... ???? !!!!
    for example i have a class "Authentication" that have a method to test if the username and password is correct or not and return 1 if true, 0 if false, -1 if thair are some problem in connecting DB.
    now if i create a normal java application that uses this method, it's work and no problems, BUT if i used a JSP page to use this method it's return allways -1

    T1 class:
    package VX;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    public class T1
    //public MBJDBConnection(String driver,String url)
    public T1()
    JDBC_DRIVER = "com.mysql.jdbc.Driver";//driver;
    DATABASE_URL = "jdbc:mysql://localhost:3306/rawafed?user=root;password=0000";//url;
    //=======DB CONNECTION===========================================
    private static String JDBC_DRIVER;
    private static String DATABASE_URL;
    protected Connection connection;
    protected Statement statement;
    //===========End DBC==============================================
    public int update(String sqlUpdate)
         int i=0;
              //connectDB();
              try{
                   i=statement.executeUpdate(""+sqlUpdate);
                   catch(Exception e)
                        System.out.println("Error Inserting Statement Or Connection Not Opened");
              //disconnectDB();
         return i;
    public ResultSet select(String sqlQuery)
              //connectDB();
              ResultSet rs;
              try
              {//open try
              rs=statement.executeQuery(""+sqlQuery);
                   return rs;
              }//end try
              catch(Exception e2)
                   //System.out.println("Error Selecting Statement Or Connection Not Opened");
              }//end catch
              //add to array list
         //return resultList;
         return null;
    //------Methods-------
    public void connectDB()
    //===========================Connection===================
    try
    Class.forName(JDBC_DRIVER);
    catch(Exception e)
    System.out.println("Error : FOR NAME");
    try
    connection = DriverManager.getConnection(DATABASE_URL, "root", "0000");
    catch(Exception e)
    System.out.println("Error : DB URL");
    try
    statement = connection.createStatement();
    catch(Exception e)
    System.out.println("Error : CREATE STATEMENT ERROR");
    public void disconnectDB()
    try
    statement.close();
    connection.close();
    catch(Exception e2)
    System.out.println("Error : CAN'T CLOSE DB");
    T2 Class
    package VX;
    // class Person.
    //Required Class : EDC.EDCDB
    import java.sql.*;
    public class T2
         public T2()
              //initialization
         //........................ Attributes .........................
         private String user;
         private String password;
         private T1 db=new T1();
         private ResultSet rs;
         //......................... Methods .........................
         public String getAdmin(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success and he is a regular employee 3: SUCCESS AND HE IS agent
              try
              user=u;
              password=p;
              rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=1");
              if(rs.next())
                   return ""+1;
              else
                   rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=2");
                   if(rs.next())
                        return ""+2;
                   else
                        rs=db.select("SELECT emp_id,password FROM Employee WHERE emp_id="+user+" AND password="+password+" AND Rank_ID=3");
                        if(rs.next())
                             return ""+3;
                        else return ""+0;
              catch(Exception e){System.out.println("Error \n"+e.getMessage());return ""+e.getMessage()+"\n"+(-1);}
         public int getCard(String u,String p)// 0: Failure, 1:Success and he is Administrator, 2: success
              user=u;
              password=p;
              try
              db.connectDB();
              rs=db.select("SELECT Card_ID,password FROM Card WHERE Card_ID='"+user+"' AND password='"+password+"'");
              if(rs.next())
                   return 1;
              return 0;
              catch(Exception w)
                   return -1;
              finally
                   //System.out.println("Done");
                   db.disconnectDB();
         public int getAny()
              return 1;
    }//end class
    This is a tested class and it's work OK
    import VX.T2;
    public class T3
         public static void main(String [] args)
              System.out.println("System Started...");
              try
                   T2 t2=new T2();
                   System.out.println(t2.getCard("1","a"));
              catch(Exception e)
                   System.out.println("Opsssss ...");
    Now this is the JSP Code that OK and Run without any problems
    <%@ page contentType="text/html; charset=windows-1256" language="java" import="java.sql.*" errorPage="" %>
    <!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=windows-1256" />
    <title>test</title>
    </head>
    <body>
    <%
    //Mazin B. Jabarin 20210464
    //Testing JSP - MySQL Server Driver
    String connectionURL = "jdbc:mysql://localhost:3306/EDCDB?user=root;password=0000";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <%
    try{
    Class.forName("com.mysql.jdbc.Driver");
    connection = DriverManager.getConnection(connectionURL, "root", "0000");
    statement = connection.createStatement();
    rs = statement.executeQuery("SELECT * FROM a");
    while (rs.next()) {
    out.println(rs.getString("id")+"<br>");
    rs.close();
    catch(Exception e)
    out.print("Error : "+e.getMessage());
    %>
    </body>
    </html>
    Now this JSP File always returns (-1) ???? !!!!!!!
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" import="VX.T2" import="java.util.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%
    try
    T2 t2=new T2();
    out.println("Result Still : "+t2.getCard("1","a"));
    catch(Exception w)
    out.println("<BR> Error In Execution ??? "+w.getMessage());
    %>
    </body>
    </html>
    ++++++++++++++++++++++++++++
    any one can help me please :(
    i use tomcat as web-application
    and i install jdk 1.5
    also JBulder 7
    (now i supposed that the JBulder make some conflict, so i uninstalled it but still Not Working) ...
    before one year i was working just like this way and it was working
    but now i dont know what is the problem
    i am really need help.

  • I have setup JSP & MySQL but how can i Connect it to eche other ?

    I feel sory by asking this qustion but i tried very enough
    100 mile start from 1 mile ^_^
    I have tested JSP files by http://localhost:8080/test.jsp
    and it works very will
    also i have already installd MySQL and i can create databases and tables by http://localhost/phpMyAdmin
    so what i have to do else to connect JSP to MySQL ? , ( if nothing )
    how can i test that MySQL Connected with JSP, so that i can display data from database ?
    Best Regards
    JMalik

    create a java bean, which is just similar to a java class and put the database connection there so you wouldn't have to include that code in all you jsps everytime you connect to the database
    this is for DbConnection.java
    package connection;
    import java.sql.*;
    import java.io.*;
    public class DBConnection
         private Connection con;
         public DBConnection()
              try
                  Class.forName("com.mysql.jdbc.Driver");
                  con = DriverManager.getConnection("jdbc:mysql://localhost/yourfolder?user=yourusername&password=yourpassword");
            catch (Exception e)
                 e.printStackTrace();
         public Connection getConnection()
              return con;
         public void close()
              try
                   con.close();
              catch(Exception e)
                   e.printStackTrace();
    }in another bean/class which connects to your database,
    say for example this is SelectUsers.java
    public String[] selectActiveUsers(int id) throws Exception, SQLException
         try
                   con = new DBConnection().getConnection();
                   Statement stmt = con.createStatement();
                   String ins = "<your select statement>";     
                            stmt.executeUpdate(ins);
                            con.close();
                   stmt.close();
             catch (SQLException se)
                    System.out.println("SQL Exception: " + se.getMessage() + "not connected");
                    se.printStackTrace(System.out);
         }and in your jsp, instantiate the class
    users.jsp
    SelectUsers su = new SelectUsers();
    String[] users = su.selectActiveUsers(1);got it?
    Message was edited by:
    shuini

  • JSP error page does not displayed on its own, includes in the original JSP

    Problem Description: - Exceptions in a Condition cause pages to fail to render.
    The actual issue is, the JSP error page does not displayed on its own, included in the original JSP Page when exception occurs.
    Problem Cause: As per the JSP specification when jsp content reached the buffer size (default 8KB) the page being flushed (Part of condent displays). The default �autoFlush� value is true.
    When the page buffer value is default size (8KB), and if any exception occurs after flushing the part of the content, instead of redirecting into error page, the error page content included in the original page.
    If i specify autoFlush="false" and with default buffer size, at the runtime if the buffer size is reached, i am getting stackoverflow error.
    To solve the above problem we can make it autoFlush=�false� and buffer=�100KB�. But we can�t predict the actual size of the page.
    I found in one of the weblogic forum as no solution for this issue. Ref.
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=wls/S-10309.htm
    Please provide me any solution to resolve the problem.

    Error-Page tags work best with an error.html pages. If you have an error.jsp page what I would do, and I have, is wrap my classes and jsp pages in a try catch block where you forward to the error jsp page and display anything you want. YOu can also do this with if else statements. I have used the tomcat error pages before but when I've implemented them I used java.lang.Exception as the error to catch not Throwable. I don't know if this would make a difference or have anything to do with your problem.

  • Ideacentre B320 display problem

    I'm suffering from a display problem, and cannot figure if it's a software or hardware issue... I'm on Win7 64bit. Here are the symptoms:
    1) For a while now, intermittently the screen would go grey (or some sort of a messed up pattern of rgb pixels) and I would have to power down forcefully. The frequency of this has gone up very much in the recent weeks
    2) When the machine freezes, I can still hear the music playing, and Windows continues to do whatever it was doing before
    3) Recently (I'm guessing after a Windows update), I wasn't able to boot into normal mode anymore. It would show the Windows splash screen, then before the login screen appears it would just go black and freeze. Leaving it for a long time doesn't lead to recovery
    4) To try and fix this, I've updated the ATI driver to the latest version, which didn't work so progressively tried every version between the11.6 and 10.3 (4?) which was the default when the machine was purchased. No luck there. I've also flashed the bios and that didn't help either
    5) I can boot into safe mode, so I disabled amdkmdap using sysinternal's autoruns.exe, which meant that I can boot into normal mode, but it woud fall back onto Windows' vga driver (1400x1050 only!)
    6) Now, even in the low res mode, almost daily the grey screen freezing would happen and I would have to reboot. Tapping the power button allows the shutdown dialog to come up (I'm guessing), and pressing enter would shut down the machine then.
    There's an awful lot of posts on the internet regarding people having issues with ATI HD6450 and similar category cards, some of which sound similar to my case. They too experienced the freezing problem and reverting or upgrading the drivers had no effect (many even reinstalled windows completely). It sounds like though, the problem is software in origin at a guess.
    On the other hand, the machine is now 3-4 years old and I could imagine that the GPU or graphics memory might have suffered wear and tear -- emailing Lenovo support took a week to get a response, the only thing they asked was whether my warranty is still active (after that it's been a complete silence) are they usually this terrible?
    The last thing is, when the problem first occurred I booted using a linux live CD and it was all fine, at full resolution graphics. I haven't repeated this experiment since it takes quite a while to boot from a CD... but suggested that the hardware is intact. In fact, by messing about with the drivers I was able to boot into Windows normal mode and operate for 1-2 days, after which the grey freeze happened again. I haven't been able to get back into that since.
    Here is my question: Is there a way to find out whether it's software or hardware that's at fault? If it turns out to be hardware, what are my options at replacements? The GPU is soldered onto the motherboard, so do I have to replace the whole thing? If it's a software issue, would restoring to factory default state fix this issue, given that an unknown update could cause the same issue at any time... This is the last time I will buy an AIO without removable everything. 

    Welcome to the Lenovo Community !
    Probably a good test of the hardware is use the Linux Live CD that you used earlier.   If the graphics are still good when using the Live CD then your monitor and GPU are fine. 
    If the hardware checks out Ok then I suspect you have a driver problem.  Try using a driver cleaner to fully uninstall the ATI driver since bit and pieces left over from previous driver installs can cause problems.  The link below is for a free and highly recommended utility for cleaning the system of the graphic drivers.  After the clean up I would try installing the original driver that came with your system.
    http://www.guru3d.com/content-page/guru3d-driver-sweeper.html
    Owner & Operator of the following:
    ● Lenovo Ideapad Z570 w/ Win 7 & Win 8.1 Dual Boot ● Lenovo Yoga 3 Pro w/ Windows 8.1 ● Toshiba A75-S206 w/ Win 7
    ● IBM Thinkpad T-23 w/ Win XP ● IBM Thinkpad T-22 w/ Win XP • As well as multiple desktops dual/triple booting XP, Vista and Win 7.
    ★ Find a post helpful? Thank that member by clicking on the ☆Star☆ to the left awarding them a Kudo.
    ★ Posting a problem and a reply is helpful and it answers your question, please mark it as an "Accepted Solution"
    ★ I'm not a Lenovo employee, just a volunteer geek who likes to help folks. Enjoy your time here, pay it forward by helping others !
    ★ Sorry, I don't answer questions via Private Messages. Posting in the appropriate forum is the best way to get assistance.

  • The display problem of Adobe Reader 11.0.09

    Hi, everyone,
    My operation system is Windows XP SP3 Professional.
    I encountered a strange display problem of Adobe Reader 11.0.09.
    The problem happened not only at Adobe Reader 11.0.09 Chinese Traditional, but also English United States.
    The display problem such as two pictures as follow.
    The strange problem was that menu bar covered by toolbar items or disappeared.
    Please tell me how to resolve the problem.
    Thanks a lot.

    Thanks for your help, Ajlan huda.
    Could you tell me where I could find the system requirement about Adobe Reader patch 11.0.09?
    I couldn't find any information about system requirement of Adobe Reader patch 11.0.09.
    I knew Adobe Reader 11 could install on Windows XP SP3 just all.
    I could install and upgrade Adobe Reader to 11.0.09 as the following picture.
    I will roll back the version of Adobe Reader from 11.0.09 to 11.0.07 and test the problem appear or not.

  • X200s Display problem

    Hi all! I would like to ask for help in diagnosing a display problem in my X200s, model 7470-5GA.
    Attached below are photos of how it looks (white flickering screen). There are times when I boot the laptop and everything appears to be normal and okay until after Windows starts and the problem comes back.
    I've tried connecting it to an external monitor. There is a signal but there is no display on the external.
    I've also tried booting Linux from a USB to check if it's only happening in Windows. The issue persists in 3 Linux distros I've tried.
    Any help would be greatly appreciated.
    X200s display problem 1
    X200s display problem 2 (with black desktop background)

    Hi Finej,
    Welcome to Lenovo Community!
    As per the query we understand that you are facing the issue with Display on your ThinkPad X200s.
    As per the snapshot I am sure it is a hardware issue and it might be with Display screen or with system board. However I request you to confirm this in BIOS mode if the issue persists in BIOS mode also.
    And also connect the external monitor while performing the BIOS boot, to perform the steps you have to keep tapping the F1 key after switching ON the system.
    Hope to hear back soon!
    Best regards,
    Hemanth Kumar
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • JSP + MYSQL question: input form value into a SQL table

    Hello,
    I am writing some JSP code to read input information from a input form to write this information into a SQL field.
    My problems are:
    - how can i pass the input form information to other jsp file ? (like Getproperty of something like this)
    - how can i move the content of any input information into a variable ? I mean something like this:
    String a1;
    username.value.of.the.input.field.in.forum_jsp = a1.in.addmessage_jsp;and then:
    int rowsAffected = stmt.executeUpdate("INSERT INTO forummessages (messagecode, " +  " usercode, " + " messagedate,  " + " message) VALUES(6,3,06/07/2007,'" + a1 + "')");------
    The SQL table looks like this:
    stmt.executeUpdate("CREATE TABLE forummessages (messagecode int AUTO_INCREMENT PRIMARY KEY, usercode int, messagedate date, message char(255) not null)");My codes are:
    forum.jsp - this one should pass the input information to addmessage.jsp
    <%@ page contentType="text/html; charset=iso-8859-2" %>
    <%@ page import="java.sql.*" %>
    <%
    Connection con = null;
    Statement stmt = null;
    try {
      Class.forName("com.mysql.jdbc.Driver");
      String url =  "jdbc:mysql://localhost:3306/mysql";
      con =  DriverManager.getConnection(url,"root", "");
      stmt = con.createStatement();
      String sql = "SELECT * FROM forummessages,users,bmwecode WHERE (forummessages.usercode=users.usercode) AND (users.bmwcode=bmwecode.bmwcode)";
      ResultSet rs = stmt.executeQuery(sql);
    %>
    <html>
    <head>
    <title>JSP + MYSQL Teszt</title>
    </head>
    <body>
    <a href="forum.jsp">Forum / Uj hozzaszolas</a>
    <a href="userlist.jsp">Felhasznalok kilistazasa</a>
    <a href="adduser.jsp">Felhasznalo hozzadasa</a>
    <a href="deletemessage.jsp">Hozzaszolas torlese</a>
    <br><br>
    <form action="addmessage.jsp" method=post">
    Felhasznalo:
    <input type="text" name="username">
    <br><br>
    Hozzaszolas:
    <input type="text" name="message">
    <br><br>
    <input type="submit" value="Uj hozzaszolas">
    <br><br>
    <table border="0">
    <tr>
    <th>messagecode</th>
    <th>user</th>
    <th>car type</th>
    <th>message</th>
    </tr>
    <%
      while(rs.next()){
    %>
    <tr>
    <td><%=rs.getInt("messagecode") %></td>
    <td><%=rs.getString("username") %></td>
    <td><%=rs.getString("bmwtype") %></td>
    <td><%=rs.getString("message") %></td>
    </tr>
    <%
      } // end while
    %>
    </table>
    </body>
    </html>
    <%
    } catch (Exception e) {
      out.println("<font color=red><h3>Error:</h3></font>" + e);
      e.printStackTrace();
    } finally {
      try {
        if (stmt!=null) {
          stmt.close();
        if (con!=null) {
          con.close();
      } catch (Exception e) {
        e.printStackTrace();
    %> ----
    addmessage.jsp
    <%@ page contentType="text/html; charset=iso-8859-2" %>
    <%@ page import="java.sql.*" %>
    <%
    Connection con = null;
    Statement stmt = null;
    try {
      Class.forName("com.mysql.jdbc.Driver");
      String url =  "jdbc:mysql://localhost:3306/mysql";
      con =  DriverManager.getConnection(url,"root", "");
      stmt = con.createStatement();
    int rowsAffected = stmt.executeUpdate("INSERT INTO forummessages (messagecode, " +  " usercode, " + " messagedate,  " + " message) VALUES(6,3,06/07/2007,'" + a1 + "')");
    } catch (Exception e) {
      out.println("<font color=red><h3>Hiba:</h3></font>" + e);
      e.printStackTrace();
    } finally {
      try {
        if (stmt!=null) {
          stmt.close();
        if (con!=null) {
          con.close();
      } catch (Exception e) {
        e.printStackTrace();
    %>
    <a href="forum.jsp">Forum / Uj hozzaszolas</a>
    <a href="userlist.jsp">Felhasznalok kilistazasa</a>
    <a href="adduser.jsp">Felhasznalo hozzadasa</a>
    <a href="deletemessage.jsp">Hozzaszolas torlese</a>
    <br><br>---
    Thank you for your help in advance.

    SELECT DISTINCT
    hou.name
    ,poh.segment1 po_num
    ,pol.line_num po_line_num
    ,poh.currency_code
    --,trunc(poh.creation_date) po_creation_date
    ,pol.cancel_flag
    ,msi.segment1 item_num
    ,pol.unit_price
    ,round(cost.item_cost,5)
    ,round((&p_rate * pol.unit_price),5) "CONVERSION"
    ,(cost.item_cost - round((&p_rate * pol.unit_price),5)) difference
    ,pov.vendor_name
    FROM
    po.po_headers_all poh
    ,po.po_lines_all pol
    ,po.po_vendors pov
    ,hr.hr_all_organization_units hou
    ,inv.mtl_system_items_b msi
    ,bom.cst_item_costs cost
    WHERE
    poh.po_header_id = pol.po_header_id
    and pov.vendor_id = poh.vendor_id
    and poh.org_id = hou.organization_id
    and hou.organization_id = :p_operating_unit
    and poh.currency_code = :p_currency
    and poh.creation_date between :po_creation_date_from and :po_creation_date_to
    and poh.type_lookup_code = 'BLANKET'
    and msi.inventory_item_id = pol.item_id
    and cost.INVENTORY_ITEM_ID = pol.ITEM_ID
    --and (cost.item_cost - pol.unit_price) <> 0
    and (cost.item_cost - round((&p_rate * pol.unit_price),5)) <> 0
    and cost.organization_id = 1
    and msi.organization_id = 1
    and cost.cost_type_id = 3 --- Pending cost type
    and nvl(upper (pol.closed_code),'OPEN') not in('CANCELLED', 'CLOSED', 'FINALLY CLOSED', 'REJECTED')
    and nvl(upper (poh.closed_code),'OPEN') not in('CANCELLED', 'CLOSED', 'FINALLY CLOSED', 'REJECTED')
    and nvl(pol.cancel_flag, 'N') = 'N'
    and &p_rate user parameter
    I want this p_rate to be passed as a user parameter.

  • JSP MYSQL ERROR moving in resultset

    Hi I am new to jsp & mysql .
    I am trying to fetch data in a multiple select list box in my jsp page from a table in mysql . It fetches the first value and then exception is generated as no data found while there is data in the table . The same data in the table is fetched when i fetch in a dynamic table . I observed that i am having problems in fetching data only in list box . Please help me. It is a part of my project.
    Thanks

    Hi
    The code was generated my macromedia dreamweaver but still i'll writing it below:
    <select name="select" size="1" multiple>
    <%
    while (Recordset1_hasData) {
    %>
    <option value="<%=((Recordset1.getObject("overridetype")!=null)?Recordset1.getObject("overridetype"):"")%>"><%=((Recordset1.getObject("overridetype")!=null)?Recordset1.getObject("overridetype"):"")%></option>
    <%
    Recordset1_hasData = Recordset1.next();
    Recordset1.close();
    Recordset1 = StatementRecordset1.executeQuery();
    Recordset1_hasData = Recordset1.next();
    Recordset1_isEmpty = !Recordset1_hasData;
    %>
    </select>

  • Final cut pro 7 interface font display problem!

    Hello,Every Editor,My final cut pro 7 have wrong font display problem!How to slove?How to resume default font?
    I create a new Accounts to slove the wrong font problem!But How to slove the problem in old Admin Accounts?thx for everyone help!
    Please forgive my poor english!THX 
    Wrong font display:
    Normal font display:

    Tom.I have uncheck the box for chinese and then restart!But it still does not slove the problem.
    Please see the Pic:
    Wrong:(click to see large)
    Normal:(click to see large)

  • OCS 10g on Linux: Forbidden page displayed

    OCS 10g on Linux: Forbidden page displayed
    I have recently downloaded OCS 10g and installed on RHEL 4 i386
    server with 4GB RAM and 40+9+9 GB Hard disk. The installation was
    smooth though very time consuming, took almost 7 hours.
    After installation when I access http://servername:7778, I get the
    welcome page. When I click on any link I get the following error:
    Forbidden
    You don't have permission to
    access /pls/orasso/orasso.wwsso_app_admin.ls_login on this server.
    Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at
    ocsserver Port 7778
    I tried checking for errors in the log file and I found the following
    entry in the apache log folder:
    [Fri Sep 30 16:56:59 2005] [warn] [client 127.0.0.1] [ecid:
    1128079619:127.0.0.1:8670:0:138,0] MOD_OC4J_0184: Failed to find an
    oc4j process for destination: home
    [Fri Sep 30 16:56:59 2005] [error] [client 127.0.0.1] [ecid:
    1128079619:127.0.0.1:8670:0:138,0] MOD_OC4J_0145: There is no oc4j
    process (for destination: home) available to service request.
    [Fri Sep 30 16:56:59 2005] [error] [client 127.0.0.1] [ecid:
    1128079619:127.0.0.1:8670:0:138,0] MOD_OC4J_0119: Failed to get an
    oc4j process for destination: home
    [Fri Sep 30 16:56:59 2005] [error] [client 127.0.0.1] [ecid:
    1128079619:127.0.0.1:8670:0:138,0] MOD_OC4J_0013: Failed to call
    destination: home's service() to service the request.
    [Fri Sep 30 16:59:13 2005] [error] [client 127.0.0.1] [ecid:
    94296745340,1] client denied by server configuration:
    proxy:http://ocsserver.mshome.net:7777/pls/orasso/orasso.wwsso_app_admin.ls_login
    Any ideas as to how to resolve the forbidden error.
    Vipul Garg

    Hello Richard,
    Thank you for the reply. I have not replaced the text in error report. The hostname is ocsserver. I am not purposely using the fully qualified hostname as I tried installing with hostname as ocsserver.matpl (matpl is the domain name set on my local Windows NT server), I was unable to access the RTC url from a local network PC running Windows 2000/XP. To check the capability of RTC I have to run the RTC url on a Windows based system. Hence I did a reinstall of the OCS 10g without a domain name in the hostname. Though in the network setting I find mshome.net as the DNS domain search path set automatically in my Linux server. I tried removing it but it automatically sets in. Is this creating problem? But after installation I restarted the server I was able to run all the opmn services of infra. Only that I was getting a forbidden page and for that I changed the password of PORTAL and ORASSO schema. One more thing I find unsual is that whenever I start the machine I find that the schema PORTAL is LOCKED(TIMED) and I have to unlock it, but it gets locked automatically once databse is restarted. Why is it happening?
    I checked the entries of processes and they are 250 as per the parameter. And 35 is the value as per the count of v$session.
    Please provide your valuable ideas in resolving the issue.
    Regards,
    Vipul

Maybe you are looking for

  • Data back up from Single User Mode

    Hello, I have a problem with my 700 MHz iBook, dual USB, with OS X 10.3.9. Unfortunately the OS doesn't start up because of "overlapped extent allocation" problem... I would like to re-install the complete OS but before doing it, I would like to back

  • I want to change the size and color of text in call out boxes and text boxes. How can I do this? Jack

    I want to change the size and color of text in call out boxes and text boxes. How can I do this? Jack

  • Lightroom not updating the originals

    I may be having a senior moment but I am running Lightroom 2.6 and have been using Lightroom since its inception, I have a PC running win7 Ultimate and use DeepMeta to upload to istockphoto and have been doing so for a long while without a problem. I

  • Can't open print & fax preferences, can't print

    I know I've read about this problem before, but I can't seem to find the thread. I'm a total novice when it comes to terminal, but I don't even know where to start. Whenever I try to print, or even open print & fax, I just get the spinning wheel. I'm

  • CS 6 forgot I linked a file?

    I have a .ai file of common data that I'm placed in multiple other .ai files.  I place the file and get the object box with the x through it.  The object will then be updated when I update the master file.   Then when I reopen a file with the linked