In this case, you've isolated your problem to the database read/write  
phase, which means it's not a Struts issue. You'll need to look again  
at your database configuration and whatever middleware you're using  
to communicate with it (e.g. JDBC, Hibernate). The specifics will  
depend on your database backend, the middleware you're using and your  
own persistence code and configuration.

L.


well i don't think that's the problem in database configuration as there're
other projects works with it fine
concerning middleware, i'm using JDBC
but i donno what should i do to make JDBC middleware compatible with utf-8
encoding

here's a snapet of JDBC connection i used ..

 public Connection dbConnect(String db_connect_string,String db_userid,
String db_password)
 {
     try
     {
         Connection conn = DriverManager.getConnection( db_connect_string,
db_userid, db_password);
         System.out.println("connected");
         return conn;
     }
     catch (Exception e)
     {
         e.printStackTrace();
         return null;
     }
 }
 
 public String getText()
 {
     String text = "";
     Statement statement = null;
  try
  {
     Connection conn = dbConnect("jdbc:oracle:thin:@localhost:1522:fat10g",
"test", "t");
     statement = conn.createStatement();
     String query = "select * from test";
     
     ResultSet resultSet = statement.executeQuery ( query ) ;
     // get the last entered row in test table
     while ( resultSet.next () )
     {
      text = resultSet.getString("test");
     }
    // text = new String(text.getBytes(), "UTF-8");
     
  }
     catch(Exception e)
     {
         e.printStackTrace();
     }
     finally //ensure statement is closed properly
          {
               try
                    {
                         statement.close () ;
                    }
               catch ( SQLException e )
                    {
                         
                    }
          }
     return text;
 }
 
 public void saveText(String text)
 {
     Statement statement = null;
     try
     {
        Connection conn =
dbConnect("jdbc:oracle:thin:@localhost:1522:fat10g", "test", "t");
         statement = conn.createStatement();
        String query = "insert into TEST (test) values ('" + text + "')";
        boolean result = statement.execute( query ) ;
     }
     catch(SQLException  e)
     {
        e.printStackTrace();
     }
     finally //ensure statement is closed properly
      {
       try
        {
          statement.close () ;
        }
       catch ( SQLException e )
        {}
      }
 }

what should i do to middleware ?
-- 
View this message in context: 
http://www.nabble.com/struts-request-encoding-to-utf-8-problem-tp15041079p15061172.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to