← Back to team overview

gephi.team team mailing list archive

[Question #150782]: DB connector from a JDBC

 

Question #150782 on Gephi changed:
https://answers.launchpad.net/gephi/+question/150782

Description changed to:
I have a JDBC and I have created a new module to write a DB Connector. I
have added the JDBC to the module and created a class that implements
SQLDriver, I understand that I will need to override the implementation
for the following. So far I have the following class in my module:

public class TestSQLDriver implements SQLDriver{

public Connection getConnection(String connectionUrl, String username, String passwd) throws SQLException {
        return DriverManager.getConnection(connectionUrl, username, passwd);
    }

@Override
    public String getPrefix() {
        return "jdbc:test://tom/will;user=admin;password=password;loglevel=2;logdirpath=C:\\";
    }

    @Override
    public String toString() {
        return "New Driver";
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof TestSQLDriver) {
            return ((TestSQLDriver) obj).getPrefix().equals(getPrefix());
        } else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        return getPrefix().hashCode();
    }
}

My JDBC URL looks something like the following:

jdbc:test://<host>/<database>;user=<username>;password=<password>; 
loglevel=<log level>;logdirpath=<log directory>

But I did not quite understand why it doesn't work. What am I missing
here? If I get this working I will be writing a tutorial on the wiki on
how to write a DB connector as there isn't any as of now. Can someone
guide me through this.

-- 
You received this question notification because you are a member of
Gephi Team, which is an answer contact for Gephi.