Created
September 14, 2016 12:55
-
-
Save ntakouris/075f8fcdecb35c8716b172b731cbc7bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String commoditiesSql = "INSERT INTO `commodities` (`diamond`, `gold`, `iron` , `utime`)" | |
+ "VALUES (" + stockhouse.diamondPrice +", " + stockhouse.goldPrice + ", " + stockhouse.ironPrice +", " + Database.getUnxTime() + ")"; | |
Statement s = null; | |
try{ | |
s = Database.createStatement(); | |
s.executeQuery(commoditiesSql); | |
}catch(Exception e){ | |
Database.connectToDB("localhost", 3306, "rainbow", "rainbow_user", "jycalhR9YYEQfnf6s5Vb"); | |
}finally{ | |
if(s!=null){ | |
try { | |
s.close(); | |
} catch (SQLException e) { | |
Database.connectToDB("localhost", 3306, "rainbow", "rainbow_user", "jycalhR9YYEQfnf6s5Vb"); | |
e.printStackTrace(); | |
//pull(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment