Hi, Martin has helped me solving the i18n problem of fetching parameter from the form. Now I can also select the 16-bit code from the database, but I can not insert the 16-bit code to database (Interbase). This seems to be a jdbc or database problem . I compile the source with command:
"javac -encoding GB2321 InsertCC.java ", but painful still is me. give help ?
 
Thanx in advance.
 
jacky
 
 
------------------------------------------------------------------------
 
  String url = "jdbc:odbc:gsd";
  Connection con;
  Statement stmt;
 
  String id = 1;
  String f1 ="abc";
  String f2 ="����";
 
  String sql ="";
  sql = sql + "INSERT INTO tablename VALUES (";
  sql = sql + id;
  sql = sql + ",'" + f1;
  sql = sql + "','" + f2;
  sql = sql + "')";
 
  try {
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  } catch(java.lang.ClassNotFoundException e) {
   System.err.print("ClassNotFoundException: ");
   System.err.println(e.getMessage());
  }
  try {
   con = DriverManager.getConnection(url, "SYSDBA", "masterkey");
   stmt = con.createStatement();      
   stmt.executeUpdate(sql);
   stmt.close();
   con.close();
  } catch(SQLException ex) {
   System.err.println("SQLException: " + ex.getMessage());
   }

Reply via email to