SlideShare une entreprise Scribd logo
1  sur  9
Running SQL from a Agile
PLM Groovy Event Handler
Introduction
 Will show how to execute SQL from a Groovy
handler using the SQL connection already
established by the container
 Should work fine in a PX – add agileclasses.jar
to the IDE classpath for the build but cannot
run in the debugger since the PX is not in
Agile’s class loader
Sample Script
import
import
import
import

com.agile.agileDSL.ScriptObj.*;
com.agile.api.*;
com.agile.util.sql.*;
java.sql.*;

void invokeScript(IBaseObjectScriptObj object) {
Connection connection = null;
PreparedStatement statement = null;
ResultSet rows = null;
try {
connection = ConnectionFactory.getFactory().getConnection();
statement = connection.prepareStatement("select ifs_url from vault");
rows = statement.executeQuery();
while(rows.next()) {
// log the SQL response
object.logMonitor( "SQL Response: " + rows.getString("ifs_url") );
}
} catch (Exception e) {
object.logMonitor( e.getMessage() );
}
}
Setting Up Agile for the Test
 Setting up the event for our demo
Setting Up Agile for the Test (cont)
 Defining the event handler
Setting Up Agile for the Test (cont)
 The event subscriber
The Results
I set up my script to execute on
the title block update event for
items, so simply modifying an
attribute on a part and saving the
changes will trigger it. If we
inspect the event monitor the
following entry is found.
About Us
 PLM Mechanic specializes in the technical
aspects of Oracle’s Agile PLM solution
 We offer the following service:
– Agile PLM installations and upgrades
– Agile PLM maintenance and help desk functions
– Agile PLM hosting
– Customization

 PLM Mechanic also has several product
offerings
Contact Us









Web: http://www.plmmechanic.com
Blog: http://www.plmmechanic.com/blog
Facebook: http://facebook.com/PLMMechanic
LinkedIn: http://www.linkedin.com/company/plm-mechanic
Twitter: @PLMMechanic
Email: sales@plmmechanic.com
Phone: 512-827-2262
Fax: 512-582-2932

Contenu connexe

Tendances

Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012
slandelle
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
Inside asp.net mvc framework
Inside asp.net mvc frameworkInside asp.net mvc framework
Inside asp.net mvc framework
Ciklum Ukraine
 

Tendances (20)

React js t6 -lifecycle
React js   t6 -lifecycleReact js   t6 -lifecycle
React js t6 -lifecycle
 
Continuous performance management with Gatling
Continuous performance management with GatlingContinuous performance management with Gatling
Continuous performance management with Gatling
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test tool
 
React js t4 - components
React js   t4 - componentsReact js   t4 - components
React js t4 - components
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
Gatling
Gatling Gatling
Gatling
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobX
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
 
Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012Gatling Tool in Action at Devoxx 2012
Gatling Tool in Action at Devoxx 2012
 
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
New Features Of Microsoft Visual Studio 2008 And .Net Framework 3.5 To Comsof...
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
 
Understanding Facebook's React.js
Understanding Facebook's React.jsUnderstanding Facebook's React.js
Understanding Facebook's React.js
 
React and redux
React and reduxReact and redux
React and redux
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Inside ASP.NET MVC framework
Inside ASP.NET MVC frameworkInside ASP.NET MVC framework
Inside ASP.NET MVC framework
 
Inside asp.net mvc framework
Inside asp.net mvc frameworkInside asp.net mvc framework
Inside asp.net mvc framework
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
Scaling React and Redux at IOOF
Scaling React and Redux at IOOFScaling React and Redux at IOOF
Scaling React and Redux at IOOF
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Why reactive:reactive programming spring 5
Why reactive:reactive programming spring 5Why reactive:reactive programming spring 5
Why reactive:reactive programming spring 5
 

Similaire à Running SQL from a Groovy Event Handler in Agile PLM

20150516 modern web_conf_tw
20150516 modern web_conf_tw20150516 modern web_conf_tw
20150516 modern web_conf_tw
Tse-Ching Ho
 
Jug Guice Presentation
Jug Guice PresentationJug Guice Presentation
Jug Guice Presentation
Dmitry Buzdin
 
Thomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-finalThomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-final
Droidcon Berlin
 
SQL Server 2005 CLR Integration
SQL Server 2005 CLR IntegrationSQL Server 2005 CLR Integration
SQL Server 2005 CLR Integration
webhostingguy
 
Our challenge for Bulkload reliability improvement
Our challenge for Bulkload reliability  improvementOur challenge for Bulkload reliability  improvement
Our challenge for Bulkload reliability improvement
Satoshi Akama
 

Similaire à Running SQL from a Groovy Event Handler in Agile PLM (20)

20150516 modern web_conf_tw
20150516 modern web_conf_tw20150516 modern web_conf_tw
20150516 modern web_conf_tw
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
 
Jug Guice Presentation
Jug Guice PresentationJug Guice Presentation
Jug Guice Presentation
 
Scrollable Test App
Scrollable Test AppScrollable Test App
Scrollable Test App
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
 
Arquillian Constellation
Arquillian ConstellationArquillian Constellation
Arquillian Constellation
 
Introduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress DevelopersIntroduction to AngularJS For WordPress Developers
Introduction to AngularJS For WordPress Developers
 
Selenium my sql and junit user guide
Selenium my sql and junit user guideSelenium my sql and junit user guide
Selenium my sql and junit user guide
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricks
 
Sqlapi0.1
Sqlapi0.1Sqlapi0.1
Sqlapi0.1
 
Apollo. The client we deserve
Apollo. The client we deserveApollo. The client we deserve
Apollo. The client we deserve
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Thomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-finalThomas braun dependency-injection_with_robo_guice-presentation-final
Thomas braun dependency-injection_with_robo_guice-presentation-final
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
SQL Server 2005 CLR Integration
SQL Server 2005 CLR IntegrationSQL Server 2005 CLR Integration
SQL Server 2005 CLR Integration
 
Loadrunner
LoadrunnerLoadrunner
Loadrunner
 
Our challenge for Bulkload reliability improvement
Our challenge for Bulkload reliability  improvementOur challenge for Bulkload reliability  improvement
Our challenge for Bulkload reliability improvement
 
Web UI test automation instruments
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
 

Plus de PLM Mechanic .

Plus de PLM Mechanic . (6)

Trying to find the workflow status in the database?
Trying to find the workflow status in the database?Trying to find the workflow status in the database?
Trying to find the workflow status in the database?
 
Is File Load Taking Too Long?
Is File Load Taking Too Long? Is File Load Taking Too Long?
Is File Load Taking Too Long?
 
Help! Agile PLM won’t start after a database import!
Help! Agile PLM won’t start after a database import! Help! Agile PLM won’t start after a database import!
Help! Agile PLM won’t start after a database import!
 
How to import the agile plm database
How to import the agile plm databaseHow to import the agile plm database
How to import the agile plm database
 
Fix Agile PLM Attachment File Sizes
Fix Agile PLM Attachment File Sizes Fix Agile PLM Attachment File Sizes
Fix Agile PLM Attachment File Sizes
 
How to Export the Agile PLM Database
How to Export the Agile PLM DatabaseHow to Export the Agile PLM Database
How to Export the Agile PLM Database
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Running SQL from a Groovy Event Handler in Agile PLM

  • 1. Running SQL from a Agile PLM Groovy Event Handler
  • 2. Introduction  Will show how to execute SQL from a Groovy handler using the SQL connection already established by the container  Should work fine in a PX – add agileclasses.jar to the IDE classpath for the build but cannot run in the debugger since the PX is not in Agile’s class loader
  • 3. Sample Script import import import import com.agile.agileDSL.ScriptObj.*; com.agile.api.*; com.agile.util.sql.*; java.sql.*; void invokeScript(IBaseObjectScriptObj object) { Connection connection = null; PreparedStatement statement = null; ResultSet rows = null; try { connection = ConnectionFactory.getFactory().getConnection(); statement = connection.prepareStatement("select ifs_url from vault"); rows = statement.executeQuery(); while(rows.next()) { // log the SQL response object.logMonitor( "SQL Response: " + rows.getString("ifs_url") ); } } catch (Exception e) { object.logMonitor( e.getMessage() ); } }
  • 4. Setting Up Agile for the Test  Setting up the event for our demo
  • 5. Setting Up Agile for the Test (cont)  Defining the event handler
  • 6. Setting Up Agile for the Test (cont)  The event subscriber
  • 7. The Results I set up my script to execute on the title block update event for items, so simply modifying an attribute on a part and saving the changes will trigger it. If we inspect the event monitor the following entry is found.
  • 8. About Us  PLM Mechanic specializes in the technical aspects of Oracle’s Agile PLM solution  We offer the following service: – Agile PLM installations and upgrades – Agile PLM maintenance and help desk functions – Agile PLM hosting – Customization  PLM Mechanic also has several product offerings
  • 9. Contact Us         Web: http://www.plmmechanic.com Blog: http://www.plmmechanic.com/blog Facebook: http://facebook.com/PLMMechanic LinkedIn: http://www.linkedin.com/company/plm-mechanic Twitter: @PLMMechanic Email: sales@plmmechanic.com Phone: 512-827-2262 Fax: 512-582-2932