Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 23-May-18 0:35am

1 solution

You have to call the method of the PreparedStatement:
Java
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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900