| 20 | } // end of OracleInterface constructor |
| 21 | |
| 22 | @Override |
| 23 | public int JdbcConnect(String[] parms, int fsize, boolean scrollable) { |
| 24 | int rc = 0; |
| 25 | String url = parms[1]; |
| 26 | DataSource ds = null; |
| 27 | OracleDataSource ods = null; |
| 28 | |
| 29 | if (DEBUG) |
| 30 | System.out.println("Connecting to Oracle data source"); |
| 31 | |
| 32 | try { |
| 33 | CheckURL(url, "oracle"); |
| 34 | |
| 35 | if ((ds = dst.get(url)) == null) { |
| 36 | ods = new OracleDataSource(); |
| 37 | ods.setURL(url); |
| 38 | |
| 39 | if (parms[2] != null) |
| 40 | ods.setUser(parms[2]); |
| 41 | |
| 42 | if (parms[3] != null) |
| 43 | ods.setPassword(parms[3]); |
| 44 | |
| 45 | ds = ods; |
| 46 | |
| 47 | dst.put(url, ds); |
| 48 | } // endif ds |
| 49 | |
| 50 | // Get a connection from the data source |
| 51 | conn = ds.getConnection(); |
| 52 | |
| 53 | // Get the data base meta data object |
| 54 | dbmd = conn.getMetaData(); |
| 55 | |
| 56 | // Get a statement from the connection |
| 57 | stmt = GetStmt(fsize, scrollable); |
| 58 | } catch (SQLException se) { |
| 59 | SetErrmsg(se); |
| 60 | rc = -2; |
| 61 | } catch( Exception e ) { |
| 62 | SetErrmsg(e); |
| 63 | rc = -3; |
| 64 | } // end try/catch |
| 65 | |
| 66 | return rc; |
| 67 | } // end of JdbcConnect |
| 68 | |
| 69 | } // end of class OracleInterface |