0

显示错误的屏幕截图

为什么在引用通过构造函数传递的变量时出现错误?

这是完整的 Customer.java 类:

import java.sql.ResultSet;
import javax.servlet.http.HttpServletRequest;

public class Customer {

    // SQL Variables
    private final String URL = "jdbc:mysql://localhost/books";
    private final String USER = "root";
    private final String PASSWORD = "P@ssw0rd1";

    // Class Variables
    int CustomerID;
    String customerEmail;
    String customerPassword;
    String customerFirstName;
    String customerLastName;
    String customerAddress;
    String customerCity;
    String customerProvince;
    String customerPostalCode;
    String customerPhoneNumber;
    String customerCreditCardNumber;
    String customerExpiryDate;
    String customerCreditCardType;

    // Class Constructors
    public Customer(int customerID) // Constructor for an Existing Customer
    {
        ResultSet customerData = MySQLQuery("select * from Customers where CustomerID=" . customerID);
    }
    public Customer(HttpServletRequest post) // Constructor for a new customer
    {

    }
    // Constructor Methods
    public ResultSet MySQLQuery(String query)
    {
        return queryResultSet;
    }
    // Getters and Setters
}

这是在 NetBeans 7.3 中在默认包内的 Customer.java 类中创建的 Java Web 项目。

4

1 回答 1

5

.当您的意思是a 时,您似乎正在使用a +

可能是一个老 PHP 程序员?:-)

于 2013-05-21T20:01:39.760 回答