Pls i will like someone to help check what is wrong with this code. It is highlighted red all over.
package com.example.myapplication.data;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Random;
import com.vaadin.data.util.BeanItemContainer;
@SuppressWarnings(“serial”)
public class SubscriberContainer extends BeanItemContainer implements Serializable{
/**
* Natural property order for Person bean. Used in tables and forms.
*/
public static final Object[] NATURAL_COL_ORDER = new Object[]
{
“subscriber_id”, “phone_number”, “customer_id”, “account_number”, “account_name”,
“wallet_number”};
/**
* "Human readable" captions for properties in same order as in
* NATURAL_COL_ORDER.
*/
public static final String[] COL_HEADERS_ENGLISH = new String[]
{
“subscriber_id”, “phone_number”, “customer_id”, “account_number”, “account_name”,
“wallet_number”};
public SubscriberContainer() throws InstantiationException,IllegalAccessException {
super(Subscriber.class);
}
private void initConnectionPool() {
try {
connectionPool = new SimpleJDBCConnectionPool(
"com.mysql.jdbc.Driver ",
" jdbc:mysql://localhost:3306/juk_app", "root", "");
} catch (SQLException e) {
showError("Couldn't create the connection pool!");
e.printStackTrace();
}
}
private void initDatabase() {
try {
Connection conn = connectionPool.reserveConnection();
Statement statement = conn.createStatement();
try {
statement.executeQuery("SELECT * FROM subscribers");
} catch (SQLException e) {
// Failed, which means that we should init the database
statement.execute
DROP TABLE IF EXISTS subscribers;
CREATE TABLE subscribers
(subscriber_id int(15) UNSIGNED NOT NULL AUTO_INCREMENT,
phone_number varchar(20) NOT NULL ,
customer_id varchar(15) ,
account_number varchar(15) NOT NULL,
account_name varchar(35),
wallet_number varchar(20) ,
PRIMARY KEY(subscriber_id),
UNIQUE (subscriber_id),
UNIQUE(phone_number) ;
statement.close();
conn.commit();
connectionPool.releaseConnection(conn);
} catch (SQLException e) {
showError("Could not create subscribers; table!");
e.printStackTrace();
}
private void initContainer() {
try {
FreeformQuery query = new FreeformQuery("SELECT * FROM subscribers",
Arrays.asList("ID"), connectionPool);
query.setDelegate(new DemoFreeformQueryDelegate());
container = new SubscriberContainer(query);
} catch (SQLException e) {
showError("Could not create an instance of SQLContainer!");
e.printStackTrace();
}
}}