Including other libraries in your plugin

Discussion in 'Plugin Development' started by TehVoyager, Jan 28, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    TehVoyager

    I've looked around the web and haven't seen how to do it. I'm coding a plugin with MySQL and need to include a Microsoft library in my plugin for it to connect to the database. I haven't been able to find how to do this. If you could tell me how or link me to where I could learn that would be great.
     
  2. Offline

    Maurdekye

    No, you don't need to include any extra libraries. Either you're using an old library before MySQL had a proprietary library premade for interfacing Java with MySQL, or it's not giving you the option to import classes when you hover over errors. If it's the second one, just restart Eclipse. Otherwise you should be using code that looks like this;
    Code:java
    1. private static Connection sql;
    2. sql = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/database", username, password);
    3. PreparedStatement query = PrepareStatement("SELECT * FROM `table`;");
    4. ResultSet results = query.executeQuery();

    If not, it's the first one.
     
Thread Status:
Not open for further replies.

Share This Page