Results 1 to 3 of 3
- 04-08-2010, 01:51 PM #1
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
Need Suggestions on this --
The exception is thrown... as stated in the topic of this thread.:cool:Java Code:Connection connection = null; PreparedStatement statement = null; try { connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:Oracle9i", "rms", "stephen00.rms"); String str = "insert into rms_accountstore( invoice_type, customer_name, customer_address, tin_number) values(?, ?, ?, ?)"; statement = connection.prepareStatement(str); if (jRadioButton1_flag) { statement.setString(1, "sales"); } else if (jRadioButton2_flag) { statement.setString(1, "tax"); } statement.setString(2, jTextField1.getText()); statement.setString(3, jTextField2.getText()); statement.setString(4, jTextField3.getText()); statement.executeQuery(); } catch (SQLException sqlException) { sqlException.printStackTrace(); } finally { try { statement.close(); connection.close(); } catch (Exception exception) { exception.printStackTrace(); System.exit(1); } }The Quieter you become the more you are able to hear !
- 04-08-2010, 04:04 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Does this happen, by any chance, when both the radio button flags are false?
Because in that situation you will not be setting the first parameter of your INSERT.
- 04-08-2010, 08:45 PM #3
Similar Threads
-
java.sql.SQLException: Closed Connection
By sunjavaboy in forum JDBCReplies: 4Last Post: 03-21-2012, 01:38 PM -
java.sql.SQLException: No suitable driver
By Heather in forum JDBCReplies: 6Last Post: 09-01-2010, 11:29 AM -
java.sql.SQLException: Exhausted Resultset
By boy22 in forum JDBCReplies: 2Last Post: 06-07-2010, 08:45 AM -
Unreported exception java.sql.SQLException
By javamula in forum AWT / SwingReplies: 4Last Post: 09-29-2009, 02:32 PM -
java.sql.SQLException: ORA-01722: invalid number
By balushanmukha in forum JDBCReplies: 0Last Post: 08-27-2008, 06:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks