Guest User

Untitled

a guest
May 8th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. package TestScript;
  2. //javac -classpath external.jar com.mycompay/myClass.java
  3. //javac -classpath /Desktop/OSbotetc thisClass.java
  4. //jar cf myJar.jar myClass.class
  5.  
  6. import org.osbot.rs07.api.ui.Skill;
  7. import org.osbot.rs07.api.Skills;
  8. import org.osbot.rs07.script.Script;
  9. import org.osbot.rs07.script.ScriptManifest;
  10.  
  11. import java.sql.Connection;
  12. import java.sql.DriverManager;
  13. import java.sql.SQLException;
  14. import java.sql.PreparedStatement;
  15.  
  16.  
  17. public class TestScript extends Script {
  18.  
  19.     public void onStart() {
  20.         log("Starting to Collect");
  21.  
  22.         this.getSkillLevel();
  23.     }
  24.  
  25.     public void onExit() {
  26.  
  27.     }
  28.  
  29.     public final int onLoop() throws InterruptedException {
  30.         return 0;
  31.     }
  32.  
  33.     public void getSkillLevel() {
  34.         String connString = "jdbc:sqlite:/home/john/Desktop/RSDB/rsdb.db";
  35.         try {
  36.             Connection conn = null;
  37.             conn = DriverManager.getConnection(connString);
  38.             log("connection made");
  39.             PreparedStatement stmt = conn.prepareStatement("insert into playertable VALUES (\"testuser\", \"[email protected]\", \"testpass\", \"1111\"");
  40.             log(stmt.execute());
  41.         } catch (Exception e) {
  42.             log("in here");
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment