Question

I got an issue where line 48 "The method setDeveloper(String) is undefined for the type dev_selects"...

I got an issue where line 48 "The method setDeveloper(String) is undefined for
the type dev_selects" Any help is appreciated

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Date;

import gUI.newer_gui;
public class dev_selects {
   public static void main(String[] args) {
       // TODO Auto-generated method stub
       Connection conn = null;
       Statement stmt = null;
       String str1 = "select Developers from New_Products";
       String str2 = "Select Game_Name from New_Products where Developer = 'EA Dice'";
       try {
           Class.forName("com.mysql.jdbc.Driver");
       } catch (ClassNotFoundException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       }      

       try {

   Connection con=DriverManager.getConnection(
           "jdbc:mysql://localhost:3306/gamesnipers"
           ,"root","Game Snipers");
  
       } catch(SQLException ex) {
           ex.printStackTrace();
       }
       try {
           Class.forName("com.mysql.jdbc.Driver").newInstance();
           conn=(Connection) DriverManager.getConnection(
                   "jdbc:mysql://localhost:3306/gamesnipers"
                   ,"root","Game Snipers");
           String dbTrue = "jbdc:mysql///test?allowMultiQueries=true";
           stmt=conn.prepareStatement(str1);
           ResultSet rsult= stmt.executeQuery(str1);
           int rsult2 = stmt.executeUpdate(str2);
           stmt.close();
           conn.close();
       ArrayList<dev_selects> DevList = new ArrayList<dev_selects>();
       while(rsult.next()) {
           dev_selects dev = new dev_selects();
           dev.setDeveloper(rsult.getString("Developer"));
           DevList.add(dev);
           }


           }catch(SQLException ex) {
               ex.printStackTrace();
                  
       }
       }
       }

0 0
Add a comment Improve this question Transcribed image text
Answer #1

You might be getting this error because the class dev_selects might have not any method called "setDeveloper(String str)".

However, since you have not provided the implementation of dev_selects class, there is no way to tell this for sure.

If you want me to assist better, kindly provide the implementation of dev_selects class.

Add a comment
Know the answer?
Add Answer to:
I got an issue where line 48 "The method setDeveloper(String) is undefined for the type dev_selects"...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am working on this code and keep getting errors like "ERROR: Syntax error: Encountered "<EOF>"...

    I am working on this code and keep getting errors like "ERROR: Syntax error: Encountered "<EOF>" at line 1, column 169." and "ERROR: Table/View 'STUDENT' does not exist. ERROR: Table/View 'STUDENT' does not exist. ERROR: Table/View 'STUDENT' does not exist." I do not know why this isn't working. Here is my code: DTCCDatabase.java import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; /** * This program creates the CoffeeDB database. */ public class DTCCDatabase {    public static void main(String[] args)...

  • JAVA sql Code an sql file that creates a 'Contractors' table. See the exercise below for...

    JAVA sql Code an sql file that creates a 'Contractors' table. See the exercise below for an example. Give your 'Contractors' table the following fields Id (integer, primary key) CompanyName (varchar, 30 characters) Phone(varchar, 12 characters) ContactName(varchar, 30 characters) Rating (integer) OutOfStateService (boolean) Also have the sql file create at least five records for the "Contractors" table. Example record: 1, Tom's Contracting, 555-555-5555, Tom Thumb, 81, true import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class TestDB...

  • Consider the following class: import java.sql. ; public class ConnDBServer / public Connection con; public ConnDBServer()...

    Consider the following class: import java.sql. ; public class ConnDBServer / public Connection con; public ConnDBServer() { try class.ForName("com.mysql.jdbc.Driver"); String url - ".jdbc.mysql://localhost:3306/db1"; con - DriverManager.getConnection(url, "root", "root"); catch (ClassNotFoundException e) { e.printStackTrace(); catch (SOLException e) { e.printStackTrace(); LaSalle College 2020-05-01 (v. 1.7) colo 22005010. 1.7 It is used to create a connection to the MySQL database db1. For example: import java.sql.* ; public class Main public static void main(String[] args) { Connection con- new ConnDBServer().con; Make the necessary changes...

  • Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId,...

    Customer (CustomerId, CustomerName) Employee (EmployeeId, EmployeeName, Salary, SupervisorId) Product(ProductId, ProductName, ListPrice) Orders (OrderId, OrderDate, CustomerId, EmployeeId, Total) OrderedProduct (OrderId, ProductId, Quantity, Price) Write the code to complete the methods in OrderJDBC.java (look for TODO items). <---**IN BOLD** throughout code. /* OrderJDBC.java - A JDBC program for accessing and updating an order database on MySQL. */ import java.io.File; import java.math.BigDecimal; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import java.util.Scanner; /** * An application for...

  • There is a problem in the update code. I need to be able to update one...

    There is a problem in the update code. I need to be able to update one attribute of the students without updating the other attributes (keeping them empty). package dbaccessinjava; import java.sql.DriverManager; import java.sql.Connection; import java.sql.SQLException; import java.sql.*; import java.io.*; import java.util.Scanner; public class DBAccessInJava { public static void main(String[] argv) {    System.out.println("-------- Oracle JDBC Connection Testing ------"); Connection connection = null; try{ Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con= DriverManager.getConnection("jdbc:oracle:thin:@MF057PC16:1521:ORCL", "u201303908","pmu"); String sql="select * from student"; Statement st; PreparedStatement ps; ResultSet rs;...

  • Written in Java I have an error in the accountFormCheck block can i get help to...

    Written in Java I have an error in the accountFormCheck block can i get help to fix it please. Java code is below. I keep getting an exception error when debugging it as well Collector.java package userCreation; import java.io.IOException; import java.net.URL; import java.util.ResourceBundle; import java.util.regex.Matcher; import java.util.regex.Pattern; import javafx.event.ActionEvent; import javafx.fxml.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.scene.text.Text; import javafx.stage.*; public class Controller implements Initializable{ @FXML private PasswordField Password_text; @FXML private PasswordField Confirm_text; @FXML private TextField FirstName_text; @FXML private TextField LastName_text;...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT