Ready and free Java class for the CRUD - operations with MySQL database
Designed by WebSofter(David Amirkhanov)
Site: wsofter.com
Email: mail.websofter@gmail.com
String connect (...) - connects to the database;
String insert (...) - adds a new data into the table of the current connection;
boolean update (...) - updates the data in the table of the current connection;
ResultSet read (...) - reads the data from the current connection table;
boolean delete (...) - deletes the data in the table of the current connection;
boolean contains (...) - checks the value of the presence on the ordinal number of the column in the table of the current connection;
boolean contains (...) - checks the value of the presence of the title column in the table of the current connection;
void close (...) - closes the connection to the current connection.
#Simple example
public String driver = "com.mysql.jdbc.Driver";
public String server = "localhost:3306";
public String db = "myDbName";
public String user = "root";
public String password = "123456";
JMySQL db = new JMySQL();
String status = db.connect(driver, server, db, user, password);
String result = db.insert("user", new String[]{"login", "password", "email", "phone", "name", "surname"}, new String[]{"MyLogin", "123456", "mail@mail.com", "8800 888 88 88", "David", "Amirkhanov"});