Skip to content

Commit

Permalink
VPD implementation as a BIRT function
Browse files Browse the repository at this point in the history
  • Loading branch information
vnijhawa committed Jun 17, 2019
1 parent 3118acc commit b8f1487
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ public void open( Properties connProperties ) throws OdaException
{
if( ! isOpen() )
openJdbcConnection( connProperties );
if (this.jdbcConn != null)
{
//Set the app context with this connection to be used
if (this.appContext != null)
{
this.appContext.put(Constants.ODACurrentOpenConnection, this.jdbcConn);
}
}
}
catch( OdaException ex )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ public void open( Properties connProperties ) throws OdaException
}
connectByUrl( url, connProperties );
}
//Set the app context with this connection to be used
if (this.appContext != null)
{
this.appContext.put(Constants.ODACurrentOpenConnection, this.jdbcConn);
}
logger.log(Level.FINER, "JDBC connection: " + jdbcConn + " is opened");
updateAppContext (connProperties);
}
Expand All @@ -177,6 +182,7 @@ private void updateAppContext(Properties connProperties) {
if (appContext == null)
appContext = new HashMap();
appContext.put(Constants.CONNECTION_PROPERTIES_STR, connProperties);
//appContext.put("rawConnection", jdbcConn);
}

/**
Expand Down Expand Up @@ -601,6 +607,7 @@ public static class Constants
public static final String TRANSACTION_SERIALIZABLE = "serializable";
public static final String CONNECTION_PROPERTIES_STR = "connectionProperties";
public static final String ODAResourceIdentiers = "odaResourceIdentifiers";
public static final String ODACurrentOpenConnection = "odaJDBCCurrentOpenConnection";

public static int getIsolationMode( String value )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,5 +1043,28 @@ private void addLog ( String methodName, Exception e ){
methodName,
"No named Parameter supported.",
e );
}
}

/**
* This API is meant to execute the update/DML sql query.
* @return
* @throws OdaException
*/
public int executeUpdate( ) throws OdaException
{

logger.logp( java.util.logging.Level.FINER,
Statement.class.getName( ),
"executeQuery",
"Statement.executeQuery( )" );
assertNotNull( preStat );
try
{
return this.preStat.executeUpdate();
}
catch ( SQLException e )
{
throw new JDBCException( ResourceConstants.QUERY_EXECUTE_FAIL , e );
}
}
}

0 comments on commit b8f1487

Please sign in to comment.