•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,789 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 994 | Replies: 0
![]() |
•
•
Join Date: Dec 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Registering driver type
Connection con=DriverManager.getConnection("jdbc:odbc:proj"); // Assigning drivermanager
con.setAutoCommit(true);
//String str="insert into dovetail values('"+id+"','"+a+"','"+b+"','"+res+"')";
String str="insert into dovetail values('ASDF','Raj','1234','198')";
Statement stmt=con.createStatement(); // creating statement object
int ret=stmt.executeUpdate(str);
System.out.println(ret);
if(ret==0)
{
System.out.println("Not Inserted");
}
else
{
System.out.println("Data Inserted Successfully");
}
/*str="select * from dovetail";
ResultSet resl=stmt.executeQuery(str);
boolean val=resl.next();
while(val)
{
//System.out.println(resl.getString(1));
val=resl.next();
}*/
System.out.println("Completed");
the following i used to update the ms-access. when i try to insert its not getting update but when i remove the commented code i,e when i retrieve the data it is getting updated.. can any one help me out.....
Connection con=DriverManager.getConnection("jdbc:odbc:proj"); // Assigning drivermanager
con.setAutoCommit(true);
//String str="insert into dovetail values('"+id+"','"+a+"','"+b+"','"+res+"')";
String str="insert into dovetail values('ASDF','Raj','1234','198')";
Statement stmt=con.createStatement(); // creating statement object
int ret=stmt.executeUpdate(str);
System.out.println(ret);
if(ret==0)
{
System.out.println("Not Inserted");
}
else
{
System.out.println("Data Inserted Successfully");
}
/*str="select * from dovetail";
ResultSet resl=stmt.executeQuery(str);
boolean val=resl.next();
while(val)
{
//System.out.println(resl.getString(1));
val=resl.next();
}*/
System.out.println("Completed");
the following i used to update the ms-access. when i try to insert its not getting update but when i remove the commented code i,e when i retrieve the data it is getting updated.. can any one help me out.....
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access avatar backup breach business code com combo connectivity daniweb data data protection database design development dropdownlist government hacker ibm internet ip isp java medicine microshaft microsoft microsoft sdk for java microsystems module ms net news normalization open platform programming reuse security server software source sql sun survey web
- facing problem in database connectivity in jsp to mysql (JSP)
- database connectivity in vc++ 6.0 (C++)
- visual basic and access (Visual Basic 4 / 5 / 6)
- visual basic and access (Visual Basic 4 / 5 / 6)
- Test Connectivity (MS SQL)
- DataBase Connectivity : (VB.NET)
- SIGNATURE HOSTING SITES (Site Layout and Usability)
- C to DataBase Connectivity (C++)
- Asp Hosting ? (ASP)
- Image Trouble (JavaScript / DHTML / AJAX)
Other Threads in the Java Forum
- Previous Thread: Export/Import Excel in java
- Next Thread: hey


Linear Mode