Click here to Skip to main content
13,627,276 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
private void SubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
C17130325U a= new C17130325U();
try
{
String query="insert into secretary(moth,offering,tithe,pledges)values(?,?,?,?)";
a.st=a.con.prepareStatement(query);
a.st= setString(1.moth,DateTextField.getText());





an error " method setString(int,String) not found

What I have tried:

private void SubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
C17130325U a= new C17130325U();
try
{
String query="insert into secretary(moth,offering,tithe,pledges)values(?,?,?,?)";
a.st=a.con.prepareStatement(query);
a.st= setString(1.moth,DateTextField.getText());
Posted 22-May-18 23:53pm
Updated 23-May-18 0:35am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You have to call the method of the PreparedStatement:
a.st = a.con.prepareStatement(query);
a.st.setString(1.moth, DateTextField.getText());
Note also that the parameter 1.moth is not a valid integer and might generate another error after fixing the initial one.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.180712.1 | Last Updated 23 May 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100