Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBCConn has no method 'initialize' #5

Closed
neurotech opened this issue Mar 14, 2014 · 2 comments
Closed

JDBCConn has no method 'initialize' #5

neurotech opened this issue Mar 14, 2014 · 2 comments

Comments

@neurotech
Copy link

Hi

When trying the example code (code here: https://gist.github.com/neurotech/383ff54d651168fd25c6) from the README when connecting to a DB2 database, I get the following error:

/Users/neurotech/tmp/refactor-jdbc/default.js:9
jdbc.initialize(config);
     ^
TypeError: Object function JDBCConn() {
    EventEmitter.call(this);
    this._config = {};
    this._conn = null;
},function JDBCPool(config ){
    var props = java.callStaticMethodSync('java.lang.System', 'getProperties');
//    props.setPropertySync("java.awt.headless", "true");
    _(config.libpath).each(function(p){java.classpath.push(p)});

    console.log(java.classpath);

    var cpds = java.newInstanceSync('com.mchange.v2.c3p0.ComboPooledDataSource');
    cpds.setDriverClassSync(config.drivername);
    cpds.setJdbcUrlSync( config.url );
    cpds.setMinPoolSizeSync(5);
    cpds.setAcquireIncrementSync(5);
    cpds.setMaxPoolSizeSync(20);
    this.cpds = cpds;

    return this;
} has no method 'initialize'
    at Object.<anonymous> (/Users/neurotech/tmp/refactor-jdbc/default.js:9:6)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

How can I get this to work?

@CraZySacX
Copy link
Owner

Try it now after pulling the latest or grabbing 0.0.3 with npm.

@neurotech
Copy link
Author

Thanks for this. The module now works using the example code in the README as a base. Champion.

CraZySacX pushed a commit that referenced this issue Feb 22, 2016
Merge CraZySacX/node-jdbc back into dash-/node-jdbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants