Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Connecting to Database

Featured Replies

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..

 

I found this helpful when I did it.

  • Author
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

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.

  • Author
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?

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.

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.

  • Author
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

did you manage to comfobble the mainframe and deltoid the flux capacitor?

I did that and it worked.

<3

  • Author
22 minutes ago, Knuckolls said:

did you manage to comfobble the mainframe and deltoid the flux capacitor?

I did that and it worked.

<3

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

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 by liverare

All direct external connections are blocked by OSBot

look into REST APIs. Once your knowledge about them suffices, make a proper REST api :).

Edited by Eagle Scripts

  • Author
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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.