@Override public String getDriverClass() { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) { return "sun.jdbc.odbc.JdbcOdbcDriver"; } else { return "oracle.jdbc.driver.OracleDriver"; } }
/** * @param strictBigNumberInterpretation true if use strict number(38) interpretation */ public void setStrictBigNumberInterpretation( boolean strictBigNumberInterpretation ) { getAttributes().setProperty( STRICT_BIGNUMBER_INTERPRETATION, strictBigNumberInterpretation ? "Y" : "N" ); } }
/** * Generates the SQL statement to add a column to the specified table * * @param tablename * The table to add * @param v * The column defined as a value * @param tk * the name of the technical key field * @param use_autoinc * whether or not this field uses auto increment * @param pk * the name of the primary key field * @param semicolon * whether or not to add a semi-colon behind the statement. * @return the SQL statement to add a column to the specified table */ @Override public String getAddColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { return "ALTER TABLE " + tablename + " ADD ( " + getFieldDefinition( v, tk, pk, use_autoinc, true, false ) + " ) "; }
if ( precision == 0 && length == 38 ) { valtype = ( (OracleDatabaseMeta) databaseMeta.getDatabaseInterface() ) .strictBigNumberInterpretation() ? TYPE_BIGNUMBER : TYPE_INTEGER;
sql += getAddColumnStatement( tablename, tmpColumn, tk, use_autoinc, pk, semicolon ) + ";" + Const.CR; sql += getDropColumnStatement( tablename, v, tk, use_autoinc, pk, semicolon ) + ";" + Const.CR; sql += getAddColumnStatement( tablename, v, tk, use_autoinc, pk, semicolon ) + ";" + Const.CR; sql += getDropColumnStatement( tablename, tmpColumn, tk, use_autoinc, pk, semicolon );
switch ( type ) { case ValueMetaInterface.TYPE_TIMESTAMP: if ( supportsTimestampDataType() ) { retval.append( "TIMESTAMP" ); } else { if ( length == 1 ) { retval.append( "CHAR(1)" ); } else if ( length > 0 && length <= getMaxVARCHARLength() ) { retval.append( "VARCHAR2(" ).append( length ).append( ')' ); } else {
@Override public String getSQLColumnExists( String columnname, String tablename ) { return getSQLQueryColumnFields( columnname, tablename ); }
@Override public String getSQLTableExists( String tablename ) { return getSQLQueryFields( tablename ); }
when( meta.getDatabaseInterface() ).thenReturn( new OracleDatabaseMeta() );
if ( precision == 0 && length == 38 ) { valtype = ( (OracleDatabaseMeta) databaseMeta.getDatabaseInterface() ) .strictBigNumberInterpretation() ? TYPE_BIGNUMBER : TYPE_INTEGER;
strictBigNumberInterpretaion.setVisible( true ); strictBigNumberInterpretaion.setChecked( ( (OracleDatabaseMeta) meta.getDatabaseInterface() ) .strictBigNumberInterpretation() ); } else { strictBigNumberInterpretaion.setVisible( false );
@Override public int getDefaultDatabasePort() { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_NATIVE ) { return 1521; } return -1; }
/** * @return true if using strict number(38) interpretation */ public boolean strictBigNumberInterpretation() { return "Y".equalsIgnoreCase( getAttributes().getProperty( STRICT_BIGNUMBER_INTERPRETATION, "N" ) ); }
strictBigNumberInterpretaion.setVisible( true ); strictBigNumberInterpretaion.setChecked( ( (OracleDatabaseMeta) meta.getDatabaseInterface() ) .strictBigNumberInterpretation() ); } else { strictBigNumberInterpretaion.setVisible( false );
@Override public String getURL( String hostname, String port, String databaseName ) throws KettleDatabaseException { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) { return "jdbc:odbc:" + databaseName; } else if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_NATIVE ) {