The value of address is not insert in database varchar2 pno field. tried from.tostring()
but not inserted but its prints through system out perfect as email adress. any idea or suggesstion how to insert it into database..
import java.io.*;
import java.util.Properties;
import javax.mail.*;
import java.sql.*;
public static void insertm(int mid,Address from,String sub){
try {
// Load the JDBC driver
Class.forName ("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@//localhost:1521/xe", "scott", "tiger");
Statement stmt = conn.createStatement();
String str = from.toString();
System.out.println(sub+str+mid);
//sql
String sql = "insert into mms(subject,pno,mid) values ('"+sub+"','"+str+"',"+mid+")";
// Execute the insert statement
stmt.executeUpdate(sql);
conn.commit();
}catch(Throwable t){}