Smuds Posted May 9, 2017 Share Posted May 9, 2017 Hi guys, trying to connect to a DB in a script. Is this possible? Using JDBC and SQLite, here's my code. https://pastebin.com/S8dmaiWz I know the path to the DB is correct, and I know the statement is correct (in fact it's never even hitting the prepared statement because it's throwing the error when it tries to connect to the DB. Ignore my horrible coding practices please Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted May 9, 2017 Share Posted May 9, 2017 Post the error. Also I think OSBot security manager prevents you from using the connection driver. Your best bet would be to have a php script that does the database stuff and then in your script use web queries to the php page. 3 Quote Link to comment Share on other sites More sharing options...
Smuds Posted May 9, 2017 Author Share Posted May 9, 2017 (edited) Sorry, thanks for the help. Originally, the error was this, java.sql.SQLException: No suitable driver found for jdbc:sqlite:/home/john/Desktop/RSDB/rsdb.db However, after adding a random line of code (new pastebin here = https://pastebin.com/zedjm2qN ) This is the new error. java.lang.ClassNotFoundException: org.sqlite.JDBC In both cases, I have ensured that the driver is in the build path so. Is this an osbot thing or am I dumb?t EDIT: Just tried to execute a python script from inside, and I got this message Blocked permission: ("java.io.FilePermission" "<<ALL FILES>>" "execute") This leads me to believe that JDBC isn't being blocked by OSbot, which means the alternative. That I am just dumb. EDIT2: For any kind soul who is still willing to help, most up to date code https://pastebin.com/Ne4NG3WH To get rid of the java.lang.ClassNotFound exception, had to change from jdbc 3.16.1 to 3.15.1 or something like that Still getting the java.sql.SQLException: No suitable driver found for jdbc:sqlite:/home/john/Desktop/RSDB/rsdb.db error though I guess I'll have to look into the PHP that LoudPacks was suggesting but at the same time plz no Edited May 9, 2017 by Smuds Quote Link to comment Share on other sites More sharing options...
Tom Posted May 9, 2017 Share Posted May 9, 2017 Yep, you gotta submit data with PHP Quote Link to comment Share on other sites More sharing options...
Botre Posted May 9, 2017 Share Posted May 9, 2017 Why is everyone insisting on using PHP? What stops you from using HTTP requests with any other server-stack that isn't aids-riddled? 1 Quote Link to comment Share on other sites More sharing options...
k9thebeast Posted May 9, 2017 Share Posted May 9, 2017 (edited) ^^^ Idk why they use Poop Hype Poop Edited May 9, 2017 by k9thebeast Quote Link to comment Share on other sites More sharing options...
Smuds Posted May 9, 2017 Author Share Posted May 9, 2017 Real talk hate PHP. Ended up doing with python. For anyone interested in the future, here's bare bones what I'm doing. Haven't really worked in the parameters to enter into the DB but I imagine that's just going to be added on to the URL. script - https://pastebin.com/y1rWUQbA flask - https://pastebin.com/NSx1eSrB 1 Quote Link to comment Share on other sites More sharing options...