Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2008, 08:41 PM
Member
 
Join Date: May 2008
Posts: 29
adeeb is on a distinguished road
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)
{
}
}
}
});
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-22-2008, 07:26 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 459
fishtoprecords is on a distinguished road
how about putting some printStackTrace() in your exception handlers. Throwing away the exceptions tends to make debugging a lot harder than it needs to be
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
image insertion into database abhiN Database 3 06-06-2008 03:31 PM
Insertion Sort in Java Java Tip Algorithms 0 04-15-2008 09:41 PM
Using PreparedStatement for insertion Java Tip Java Tips 0 02-06-2008 11:30 AM
database insertion abhiN New To Java 0 01-17-2008 09:24 AM
Insertion sort algorithm Albert Advanced Java 2 06-28-2007 10:26 PM


All times are GMT +3. The time now is 01:47 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org