MassRS Posted September 20, 2018 Share Posted September 20, 2018 So i'm having problems with connecting to my MS Access database with UcanAccess. I found this snippet on google: // variables Connection connection = null; Statement statement = null; ResultSet resultSet = null; // Step 1: Loading or registering Oracle JDBC driver class try { Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");//Loading Driver } catch(ClassNotFoundException cnfex) { log("Problem in loading or " + "registering MS Access JDBC driver"); cnfex.printStackTrace(); } // Step 2: Opening database connection try { log("TRYING TO CONNECT DB"); String msAccDB = "C:\\Database\\DB1.accdb"; String dbURL = "jdbc:ucanaccess://" + msAccDB; // Step 2.A: Create and get connection using DriverManager class connection = DriverManager.getConnection(dbURL); // Step 2.B: Creating JDBC Statement statement = connection.createStatement(); // Step 2.C: Executing SQL & retrieve data into ResultSet resultSet = statement.executeQuery("SELECT * FROM bots"); // processing returned data and printing into console while(resultSet.next()) { log("DB CONNECTED"); log(resultSet.getInt(1) + "\t" + resultSet.getString(2) + "\t" + resultSet.getString(3) + "\t" + resultSet.getBoolean(4) + "\t" + resultSet.getBoolean(5)); } } catch(SQLException sqlex){ sqlex.printStackTrace(); } But i can't seem to succesfully load the driver, i get this message in the log: [INFO][Bot #1][09/20 10:02:27 PM]: Problem in loading or registering MS Access JDBC driver [INFO][Bot #1][09/20 10:02:27 PM]: TRYING TO CONNECT DB I have the .jar's from UcanAccess. I've tried the following already: - Place the .jar's in the Eclipse workspace. - Place the .jar's in the Eclipse workspace in my package folder. - Imported the .jar's in Eclipse as External jar's. Can't seem to figure this out.. Quote Link to comment Share on other sites More sharing options...
Naked Posted September 20, 2018 Share Posted September 20, 2018 I found this helpful when I did it. Quote Link to comment Share on other sites More sharing options...
MassRS Posted September 20, 2018 Author Share Posted September 20, 2018 6 minutes ago, NakedPotato said: I found this helpful when I did it. Does it work with a Access database? I think that method is for mysql db's Quote Link to comment Share on other sites More sharing options...
Zummy Posted September 20, 2018 Share Posted September 20, 2018 4 minutes ago, massih said: Does it work with a Access database? I think that method is for mysql db's I actually changed to a mysql db for my project. Unless you really need it to work with an Access db i'd recommend doing the same. Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted September 20, 2018 Share Posted September 20, 2018 JDBC / External libraries are blocked by OSBot. Quote Link to comment Share on other sites More sharing options...
MassRS Posted September 20, 2018 Author Share Posted September 20, 2018 6 minutes ago, Zummy said: I actually changed to a mysql db for my project. Unless you really need it to work with an Access db i'd recommend doing the same. At this moment that isn't an option for me. There must be some kind of way to get the driver working right? Quote Link to comment Share on other sites More sharing options...
Naked Posted September 20, 2018 Share Posted September 20, 2018 1 minute ago, massih said: At this moment that isn't an option for me. There must be some kind of way to get the driver working right? There is probably a way. It will require lots of rigging I imagine. Quote Link to comment Share on other sites More sharing options...
Zummy Posted September 20, 2018 Share Posted September 20, 2018 2 minutes ago, massih said: At this moment that isn't an option for me. There must be some kind of way to get the driver working right? There is always a way! I'm afraid I don't have the proper knowledge to help you out tho, sorry. Quote Link to comment Share on other sites More sharing options...
MassRS Posted September 20, 2018 Author Share Posted September 20, 2018 4 minutes ago, HeyImJamie said: JDBC / External libraries are blocked by OSBot. Only for scripts on SDN right? because people with mysql db's also use JDBC Quote Link to comment Share on other sites More sharing options...
Knuckolls Posted September 20, 2018 Share Posted September 20, 2018 did you manage to comfobble the mainframe and deltoid the flux capacitor? I did that and it worked. Quote Link to comment Share on other sites More sharing options...
MassRS Posted September 20, 2018 Author Share Posted September 20, 2018 22 minutes ago, Knuckolls said: did you manage to comfobble the mainframe and deltoid the flux capacitor? I did that and it worked. I did that for my wireless energy transfering module wich shoots electro beams in to the ionosphere and had my cat work as receiver. It worked then... But didnt work for this. Ly2 Quote Link to comment Share on other sites More sharing options...
liverare Posted September 20, 2018 Share Posted September 20, 2018 (edited) Try following these instructions: Quote I created a folder on my Desktop and put in the following: osbot-sql/ osbot-sql/lib/<YOUR DB CONNECTOR JAR FILE> osbot-sql/lib/OSBot 2.5.8.jar osbot-sql/Start OSBot with SQL Driver.bat The contents of the batch file is as follows: "C:\Program Files\Java\jre1.8.0_172\bin\java.exe" -cp "lib/*" org.osbot.Boot -debug The first bit "C:\...\..\..\" can be changed to just "java" if your running version of Java is compatible with OSBot. Mine isn't. If yours is, then you can simply do the following: java -cp "lib/*" org.osbot.Boot -debug Edited September 20, 2018 by liverare Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted September 21, 2018 Share Posted September 21, 2018 (edited) All direct external connections are blocked by OSBot look into REST APIs. Once your knowledge about them suffices, make a proper REST api . Edited September 21, 2018 by Eagle Scripts 1 Quote Link to comment Share on other sites More sharing options...
MassRS Posted September 21, 2018 Author Share Posted September 21, 2018 2 hours ago, Eagle Scripts said: All direct external connections are blocked by OSBot look into REST APIs. Once your knowledge about them suffices, make a proper REST api . Thank you sir 1 Quote Link to comment Share on other sites More sharing options...