Hai Ecartis,
                 I tried to display Unicode characters in a browser(Internet Explorer 5.0)  using a JSP(Java Server Page) stored in Oracle 8i.To some extent it is working fine. But  some characters are not at all displayed in the browser.What should I do in order to display them.I thought that I did all the things properly.What should I do in order to display them in the Browser.
 
My System Configuration:
 
OS: Windows2000 Professional
Database: Oracle 9i ( But connected to Oracle 8i server  database and stored Unicode Characters through isql*plus )
Webserver :jakarta-tomcat-3.2.1
My Database's NLS_NCHAR is UTF-8.
Java: JDK1.3
 
Please let me know how to display all the characters in my browser.
 
 
 
My  JSP Code: //  This JSP just retrieves unicode characters from Oracle 8i database and displays them in  the browser.
 
######################################################################################
 
<html>
<head>
<meta http-equiv="content-type" content="text-html; charset=UTF-8"/>
<title>
A Page to Test Telugu Characters
</title>
</head>
 
<body bgcolor='#99CCFF' text=Green>
 
  <h2>
  <MARQUEE scrollamount="4" behavior="alternate"> Display of Unicode Characters Retrieved from Oracle 8i</MARQUEE>
  </h2>
 
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<%@ page contentType="text/html; charset=UTF-8" %>
 

<%
 Connection con=null;
 Statement stmt=null;
 ResultSet rs=null;
 String fileid = null;
 String catName=null;
 
  try
    {
 
 
 Class.forName("oracle.jdbc.driver.OracleDriver");
 
 System.out.println("loaded the driver");
 
 System.out.println("*******before getting a connection");
  
 con = DriverManager.getConnection("jdbc:oracle:thin:@VISIC43:1521:TEST","unicode","unicode");
 
 System.out.println("*******after getting aconnection");
 
 if(con!=null)
  System.out.println(" got the Database Connection"); 
 else
  System.out.println("Failed to get a connection from the database");
 
 stmt = con.createStatement();
 
 System.out.println("Statement object created");
 

 try{
 
  String queryStr = "SELECT * FROM testnchar";
  System.out.println("*****************");
  rs= stmt.executeQuery(queryStr);
  System.out.println("*****************");
 
    } catch(SQLException ex) {
     ex.printStackTrace();
     System.err.println("SQLException: " + ex.getMessage());
         }
 
 
   while(rs.next())
                  {
 
   String temp =rs.getString("col1");
   fileid = new String(temp.getBytes(),"UTF-8");
   System.out.println(temp);  
    
%>   
 
  <br<br>  
       <font color="#cc0080" face="small Arial, Helvetica, sans-serif">
      <h3> <%= fileid %> </h3>
  </font>
        
    
 
       
<% 
           }
 
  rs.close();
  stmt.close();
  con.close();
 
 
     } catch(Exception e){
        e.printStackTrace();
                  }
 
%>
 
</body>
</html>
 
#####################################################
 
 
Thanks in Advance.
 
Please respond immediately.
 
with Regards,
Sreedhar.M

Reply via email to