Results 1 to 2 of 2
Thread: Regarding Data Insertion
- 06-08-2008, 06:41 PM #1
Member
- Join Date
- May 2008
- Posts
- 29
- Rep Power
- 0
Regarding Data Insertion
Hi,
I have written the code for application and it compiles and i get the output also without any errors.But when i type text and click add button the values are not being inserted. Some one please help me.
add.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
if(ae.getActionCommand()=="Add")
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc.odbc.addissue"," library","bismillah");
PreparedStatement ps = conn.prepareStatement("INSERT INTO addissue VALUES(?,?,?,?)");
String str0 = addtf.getText();
String str1 = addtf1.getText();
String str2 = addtf2.getText();
String str3 = addtf3.getText();
ps.setInt(1,Integer.parseInt(str0));
ps.setString(2,str1);
ps.setString(3,str2);
ps.setString(4,str3);
ps.executeUpdate();
conn.close();
}
catch(Exception ce)
{
}
}
}
});
- 06-22-2008, 05:26 AM #2
Similar Threads
-
image insertion into database
By abhiN in forum JDBCReplies: 4Last Post: 01-05-2009, 05:09 AM -
Insertion Sort in Java
By Java Tip in forum AlgorithmsReplies: 0Last Post: 04-15-2008, 07:41 PM -
Using PreparedStatement for insertion
By Java Tip in forum Java TipReplies: 0Last Post: 02-06-2008, 09:30 AM -
database insertion
By abhiN in forum New To JavaReplies: 0Last Post: 01-17-2008, 07:24 AM -
Insertion sort algorithm
By Albert in forum Advanced JavaReplies: 2Last Post: 06-28-2007, 08:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks