Java NetBeans JDBC Connection working in Debug, not in Run
I'm building a little internal tool (non-production code) that gets some stuff from our MS SQL DB.  I wanted to try out NetBeans 6.9.1 so am using that.

I have this fuction to connect to the DB, and I have the System DSN for FAND_DEV setup as SQL Native Client.

private static Connection GetConnection() {
            Connection conn = null;
        try {            
            conn = DriverManager.getConnection("jdbc:odbc:FAND_DEV");
        } catch (SQLException ex) {
            Logger.getLogger(DAL.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return conn;
}

When I step through the code in debug mode everything is working perfectly.  I am getting the expected data back from the DB with no problems.

However, when I try to run (Run Main Project in NetBeans) it is throwing an exception on the DB connection.  Any help on this would be greatly appreciated.

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
        at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
        at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3907)
        at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5698)
        at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:354)
        at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1503)
        at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:381)
        at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:207)
        at gosDbCopy.db.DAL.GetConnection(DAL.java:53)

Java NetBeans JDBC Connection working in Debug, not in Run
===

I'm building a little internal tool (non-production code) that gets some stuff from our MS SQL DB.  I wanted to try out NetBeans 6.9.1 so am using that.

I have this fuction to connect to the DB, and I have the System DSN for FAND_DEV setup as SQL Native Client.

private static Connection GetConnection() {
            Connection conn = null;
        try {            
            conn = DriverManager.getConnection("jdbc:odbc:FAND_DEV");
        } catch (SQLException ex) {
            Logger.getLogger(DAL.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return conn;
}

When I step through the code in debug mode everything is working perfectly.  I am getting the expected data back from the DB with no problems.

However, when I try to run (Run Main Project in NetBeans) it is throwing an exception on the DB connection.  Any help on this would be greatly appreciated.

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
        at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
        at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3907)
        at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5698)
        at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:354)
        at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1503)
        at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:381)
        at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:207)
        at gosDbCopy.db.DAL.GetConnection(DAL.java:53)
