The Artima Developer Community
Sponsored Link

Java Answers Forum
help with INSERT statement

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
ben

Posts: 57
Nickname: loftty
Registered: Oct, 2002

help with INSERT statement Posted: Dec 4, 2002 9:55 AM
Reply to this message Reply
Advertisement
hello everyone i hope someone can help me.
i have this code which is below.
i have a GUI where the user puts in his table names and the columns to be inserted into. for example he would enter 10 diffrent table and column names to insert his text to. but if the user put in the same table name in the GUI.
for example he would type in TextField1 Customers
and in TextField2 he also Typed in customers.
how would i be able test if the table name is the same table name in another prepared statement and if it is use only 1 INSERT statement to insert the text to the 2 columns?




String id = "hello";
String firstname = "james";
String stmp = JTextField1.getText();
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO "+stmp+ "([FirstName]) VALUES (?, ?)");

pstmt.setString(1, id);
pstmt.setString(2, firstname);

Topic: help with a error Previous Topic   Next Topic Topic: Max Heap , real free memory and GC invoke

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use