Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.ResultSet;
- import java.sql.Statement;
- public class Update
- {
- public static Integer UpdateBands(int num1, int num2){
- Update.UpdateBands1(num2, num1);
- Update.UpdateBands2(num2, num1);
- return(1);
- }
- public static Integer UpdateBands1(int num1, int num2){
- int number=0;
- number = Max.ShowMaxRank();
- number++;
- Connection connection = null;
- ResultSet resultSet = null;
- Statement statement = null; {
- try
- {
- String fine = Testfortest.ShowBand(num2);
- String fine2 = Testfortest.ShowBand(num1);
- Class.forName("org.sqlite.JDBC");
- connection = DriverManager.getConnection("jdbc:sqlite:" +"/home/ovaaq/Projects/Band preferece calculator/bands.sqlite");
- statement = connection.createStatement();
- resultSet = statement
- .executeQuery("UPDATE bands SET Rank='" + num1 + "' WHERE Name ='" + fine + "'");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- try
- {
- resultSet.close();
- statement.close();
- connection.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- return(1);
- }
- public static Integer UpdateBands2(int num1, int num2){
- int number=0;
- number = Max.ShowMaxRank();
- number++;
- Connection connection = null;
- ResultSet resultSet = null;
- Statement statement = null; {
- try
- {
- String fine = Testfortest.ShowBand(num2);
- String fine2 = Testfortest.ShowBand(num1);
- Class.forName("org.sqlite.JDBC");
- connection = DriverManager.getConnection("jdbc:sqlite:" +"/home/ovaaq/Projects/Band preferece calculator/bands.sqlite");
- statement = connection.createStatement();
- resultSet = statement
- .executeQuery("UPDATE bands SET Rank='" + num2 + "' WHERE Name ='" + fine2 + "'");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- try
- {
- resultSet.close();
- statement.close();
- connection.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- }
- return(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement