Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

saving messages

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hi every one i hve tried alot but cant save the incoming messages through java mail API into database ACCESS here is my code plz do do respond. It is not giving any errors at compile time of any kind but still not saving
//FOR DATABASE

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

String sourceURL = "jdbc dbc:junk";
Connection databaseConnection=DriverManager.getConnection(sourceURL);
Statement statement=databaseConnection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

Subject=message[i].getSubject().toString();
Message=message[i].getContent().toString();
From=message[i].getFrom()[0].toString();
String Date="none";
PreparedStatement stat = databaseConnection.prepareStatement("INSERT INTO MINFO (From,Subject,Message,Date) VALUES(?,?,?,?)");
stat.setString(1,From);
stat.setString(2,Subject);
stat.setString(3,Message);
stat.setString(4,Date);
stat.executeUpdate();
stat.close();
}
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hon, please do not cross-post the same question in multiple forums -- it is against JavaRanch policy. Please continue any discussion here.
I am requesting that this topic be closed.
bear
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Done.
 
His brain is the size of a cherry pit! About the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic