473,416 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Insert query problem

when executing an insert query in java it is not updating the table with the new values.
i've noticed that the problem occurs when the tables contain key/keys. it shows that the query was executed successfully but i can't see the new values.
more over when i'm trying to execute 2 insert queries one after another with the same values, i get an sql exception but now the table updates with the new values...
any ideas anybody?


private static void EndOfHire(int S_id, int P_id, float Rank, String Comment)throws Exception {
Connection conn = getConnection();
Statement st = conn.createStatement();
st = conn.createStatement();
String sql = "INSERT INTO tbl_Hire (Sitter_ID, Parent_ID) VALUES ("+S_id+","+P_id+")";
System.out.println(sql);
st.executeUpdate(sql);

Aug 14 '10 #1
0 860

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Lol McBride | last post by:
Hi all, I'm using Python 2.3 and the MySQLDB module on a Mandrake Linux 9.2 system and I'm encountering a problem whentrying to insert a string object intoa varchar field in a database I'm using....
2
by: avinash | last post by:
hello myself avinash i am developing on application having vb 6 as front end and sql server 7 as back end. when i use insert query to insert data in table then the date value of that query is...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
11
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These...
8
by: Santy | last post by:
Hello All, I am new to DB2, Currently i am using DB2 version 8.02 personal edition on Windows XP Professional. And Facing problem with rowlock in insert query. I have created a sample database...
3
by: star111792 | last post by:
hi, i have just started learning ASP. i m doing database connectivity in ASP. my problem is with the insert query. i have a page "form.asp" for taking input from user. after entering data...
2
by: kaushalgajjar | last post by:
Hi there i have a problem in inserting a query to Access database. i am having a column which is AutoNumber and if i skip that field in insert query from vb.net then it is giving me an error "Syntax...
1
by: billypit | last post by:
Hi, In my project i have one table production.Now i have to make application in which i have to insert new data in table by fields of form made in access.I don't know how to use form field's values...
2
by: agarwalsunitadhn | last post by:
hello. I had created an web application that was working well and for the same i created a deployed file. But my problem is that it handle the database well when there is a select query but when...
2
by: Limno | last post by:
insert into test (userid,question_id) ('1',select question_id from question ORDER BY RAND() LIMIT 2 ) i need to insert values from question table with userid as 1. How can i solve ths problem...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.