Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #19092
| Received | by 10.66.72.73 with SMTP id b9mr1294096pav.9.1349326054307; Wed, 03 Oct 2012 21:47:34 -0700 (PDT) |
|---|---|
| Received | by 10.68.212.99 with SMTP id nj3mr1909236pbc.20.1349326054293; Wed, 03 Oct 2012 21:47:34 -0700 (PDT) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!newsfeed.news.ucla.edu!usenet.stanford.edu!kr7no3836755pbb.0!news-out.google.com!t10ni23609125pbh.0!nntp.google.com!kt20no9058317pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.programmer |
| Date | Wed, 3 Oct 2012 21:47:34 -0700 (PDT) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=117.195.44.25; posting-account=kTEePAoAAACEMTLiFklf7VDluCvVE8iQ |
| NNTP-Posting-Host | 117.195.44.25 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <110ed4b2-e29a-4c6d-81df-3eee8e532a7c@googlegroups.com> (permalink) |
| Subject | problem in inserting record in ms access. |
| From | Navnath Gadakh <navnathgadakh@gmail.com> |
| Injection-Date | Thu, 04 Oct 2012 04:47:34 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.java.programmer:19092 |
Show key headers only | View raw
package javaapplication3;
import java.sql.*;
public class JavaApplication3 {
Connection con;
Statement st;
ResultSet rs;
public JavaApplication3()
{
connect();
}
public void connect()
{
try
{
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
Class.forName(driver);
String db = "jdbc:odbc:db1";
con = DriverManager.getConnection(db);
st = con.createStatement();
String sql = "select * from Table1";
rs = st.executeQuery(sql);
while(rs.next())
{
String fname = rs.getString("fname");
String lname = rs.getString("lname");
String address = rs.getString("address");
String email = rs.getString("email");
String mobile = rs.getString("mobile");
System.out.println(fname+lname+address+email+mobile);
}
}catch(Exception ex)
{
}
try
{
rs.moveToInsertRow();
rs.updateString("fname","abc");
rs.updateString("lname","xyz");
rs.updateString("address","mubmai");
rs.updateString("email","abc@gmail.com");
rs.updateString("mobile","99854874154");
rs.insertRow();
st.close();
rs.close();
}
catch(Exception err)
{
System.out.println("Error!!!");
}
}
public static void main(String[] args) {
// TODO code application logic here
new JavaApplication3();
}
}
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
problem in inserting record in ms access. Navnath Gadakh <navnathgadakh@gmail.com> - 2012-10-03 21:47 -0700
Re: problem in inserting record in ms access. Martin Gregorie <martin@address-in-sig.invalid> - 2012-10-04 19:39 +0000
Re: problem in inserting record in ms access. Arne Vajhøj <arne@vajhoej.dk> - 2012-10-04 17:35 -0400
Re: problem in inserting record in ms access. Martin Gregorie <martin@address-in-sig.invalid> - 2012-10-04 23:24 +0000
Re: problem in inserting record in ms access. Arne Vajhøj <arne@vajhoej.dk> - 2012-10-05 20:27 -0400
Re: problem in inserting record in ms access. Martin Gregorie <martin@address-in-sig.invalid> - 2012-10-06 11:36 +0000
Re: problem in inserting record in ms access. Arne Vajhøj <arne@vajhoej.dk> - 2012-10-06 09:08 -0400
Re: problem in inserting record in ms access. Roedy Green <see_website@mindprod.com.invalid> - 2012-10-04 20:33 -0700
Re: problem in inserting record in ms access. Lew <lewbloch@gmail.com> - 2012-10-05 10:48 -0700
csiph-web