LSX allows LotusScript code to connect to and exchange data with external databases. It provides several methods with different performance, platform independence, and whether it requires a native client. The presentation explores using LSX to read and write data between a Notes database and an Access or Oracle database. Code examples demonstrate connecting via ODBC, retrieving records from SQL and writing them to Notes documents, and inserting Notes document fields into SQL tables. Overall LSX provides a way to interface Notes with other databases for bulk data transfer applications.
Grokking TechTalk #24: Kafka's principles and protocolsGrokking VN
Bài talk sẽ giới thiệu về Kafka, và đào sâu về các principles của Kafka, các thiết kế của Kafka để làm Kafka nhanh, scalable và độ ổn định cao. Bài talk cũng chia sẻ về cách Kafka servers tương tác với Kafka clients.
Bài talk đào sâu vào internals của Kafka và phân tích tại sao các design decisions được thiết kế như vậy. Bài talk phù hợp cho các bạn software engineer đã, đang muốn tìm hiểu về các job queue, message queue khác nhau.
Speaker: Nguyen Quang Minh
- Software Engineer, Technical Lead @ Employment Hero
- Contributor of `ruby-kafka` (the most popular Kafka client for Ruby)
Slides for a college course in "Advanced Ethical Hacking" at CCSF. Instructor: Sam Bowne
Course Web page:
https://samsclass.info/124/124_F17.shtml
Based on "Penetration Testing: A Hands-On Introduction to Hacking" by Georgia Weidman -- ISBN-10: 1593275641, No Starch Press; 1 edition (June 8, 2014)
The Windows Communication Foundation (WCF) framework is being used in almost all .NET development platforms: Windows clients, ASP.NET applications, Windows Phone, Server side applications, and in Windows Azure; but have you ever wondered how WCF works? How you can extend it to your organization’s needs? How to monitor its work? How to tune it for better performance and scalability? WCF is the second largest assembly in the .NET Framework and as complex to understand.
In this 1-day workshop we will deep dive into WCF, learn how to monitor WCF services and how to troubleshoot them, how to tweak our services for better performance, how to secure them with transport and message security and discuss the pros and cons of each technique, and how to extend the WCF service pipeline to accommodate our needs.
Windows Communication Foundation (WCF) is one of the leading technologies for building distributed applications. WCF 4.5 which ships with the new .NET 4.5 and Visual Studio 2012 introduces many new features that both simplifies the way we create services and enables us improve the way our services work. In this session we will see many of the new features offered by WCF 4.5 – configuration Intellisense, cleaner configuration for IIS, UDP and WebSockets supports, and many more.
For a college class in Ethical Hacking and Network Defense at CCSF, by Sam Bowne. More info at https://samsclass.info/123/123_F17.shtml
Based on this book
Hands-On Ethical Hacking and Network Defense, Third Edition by Michael T. Simpson, Kent Backman, and James Corley -- ISBN: 9781285454610
CNIT 129S: 9: Attacking Data Stores (Part 1 of 2)Sam Bowne
Slides for a college course based on "The Web Application Hacker's Handbook", 2nd Ed.
Teacher: Sam Bowne
Twitter: @sambowne
Website: https://samsclass.info/129S/129S_F16.shtml
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...Benedek Menesi
This session has been presented in the Best Practices track at the IBM Connect conference in Orlando, FL, USA, January 2014.
--
Being armed with the newest set of weapons is crucial for not being left behind when it comes to efficiently administering your servers. The number of new features added to recent IBM releases is staggering, yet workload time constraints cause us to stick to our old ways of doing things despite the opportunity to increase our effectiveness and thereby efficiency. In this in-depth, problem/solution formatted session we’ll discuss some of the latest and greatest features for administering IBM Domino, IBM iNotes and IBM Traveler through customer examples and real world scenarios. We’ll share best practices that allowed us to successfully solve architecture challenges in critical areas such as security, mail routing, replication, web/mobile capabilities and more.
Hear Ryan Millay, IBM Cloudant software development manager, discuss what you need to consider when moving from world of relational databases to a NoSQL document store.
You'll learn about the key differences between relational databases and JSON document stores like Cloudant, as well as how to dodge the pitfalls of migrating from a relational database to NoSQL.
Présentation de MySQL 8.0 est des nouveautés récentes dans les toutes dernières versions ainsi que des informations sur la prochaine beta du MySQL Operator for Kubernetes
Grokking TechTalk #24: Kafka's principles and protocolsGrokking VN
Bài talk sẽ giới thiệu về Kafka, và đào sâu về các principles của Kafka, các thiết kế của Kafka để làm Kafka nhanh, scalable và độ ổn định cao. Bài talk cũng chia sẻ về cách Kafka servers tương tác với Kafka clients.
Bài talk đào sâu vào internals của Kafka và phân tích tại sao các design decisions được thiết kế như vậy. Bài talk phù hợp cho các bạn software engineer đã, đang muốn tìm hiểu về các job queue, message queue khác nhau.
Speaker: Nguyen Quang Minh
- Software Engineer, Technical Lead @ Employment Hero
- Contributor of `ruby-kafka` (the most popular Kafka client for Ruby)
Slides for a college course in "Advanced Ethical Hacking" at CCSF. Instructor: Sam Bowne
Course Web page:
https://samsclass.info/124/124_F17.shtml
Based on "Penetration Testing: A Hands-On Introduction to Hacking" by Georgia Weidman -- ISBN-10: 1593275641, No Starch Press; 1 edition (June 8, 2014)
The Windows Communication Foundation (WCF) framework is being used in almost all .NET development platforms: Windows clients, ASP.NET applications, Windows Phone, Server side applications, and in Windows Azure; but have you ever wondered how WCF works? How you can extend it to your organization’s needs? How to monitor its work? How to tune it for better performance and scalability? WCF is the second largest assembly in the .NET Framework and as complex to understand.
In this 1-day workshop we will deep dive into WCF, learn how to monitor WCF services and how to troubleshoot them, how to tweak our services for better performance, how to secure them with transport and message security and discuss the pros and cons of each technique, and how to extend the WCF service pipeline to accommodate our needs.
Windows Communication Foundation (WCF) is one of the leading technologies for building distributed applications. WCF 4.5 which ships with the new .NET 4.5 and Visual Studio 2012 introduces many new features that both simplifies the way we create services and enables us improve the way our services work. In this session we will see many of the new features offered by WCF 4.5 – configuration Intellisense, cleaner configuration for IIS, UDP and WebSockets supports, and many more.
For a college class in Ethical Hacking and Network Defense at CCSF, by Sam Bowne. More info at https://samsclass.info/123/123_F17.shtml
Based on this book
Hands-On Ethical Hacking and Network Defense, Third Edition by Michael T. Simpson, Kent Backman, and James Corley -- ISBN: 9781285454610
CNIT 129S: 9: Attacking Data Stores (Part 1 of 2)Sam Bowne
Slides for a college course based on "The Web Application Hacker's Handbook", 2nd Ed.
Teacher: Sam Bowne
Twitter: @sambowne
Website: https://samsclass.info/129S/129S_F16.shtml
IBM Connect 2014 BP103: Ready, Aim, Fire: Mastering the Latest in the Adminis...Benedek Menesi
This session has been presented in the Best Practices track at the IBM Connect conference in Orlando, FL, USA, January 2014.
--
Being armed with the newest set of weapons is crucial for not being left behind when it comes to efficiently administering your servers. The number of new features added to recent IBM releases is staggering, yet workload time constraints cause us to stick to our old ways of doing things despite the opportunity to increase our effectiveness and thereby efficiency. In this in-depth, problem/solution formatted session we’ll discuss some of the latest and greatest features for administering IBM Domino, IBM iNotes and IBM Traveler through customer examples and real world scenarios. We’ll share best practices that allowed us to successfully solve architecture challenges in critical areas such as security, mail routing, replication, web/mobile capabilities and more.
Hear Ryan Millay, IBM Cloudant software development manager, discuss what you need to consider when moving from world of relational databases to a NoSQL document store.
You'll learn about the key differences between relational databases and JSON document stores like Cloudant, as well as how to dodge the pitfalls of migrating from a relational database to NoSQL.
Présentation de MySQL 8.0 est des nouveautés récentes dans les toutes dernières versions ainsi que des informations sur la prochaine beta du MySQL Operator for Kubernetes
Access Data from XPages with the Relational ControlsTeamstudio
Did you know that Domino and XPages allows for the easy access of relational data? These exciting capabilities in the Extension Library can greatly enhance the capability of your applications and allow access to information beyond Domino. Howard and Paul will discuss what you need to get started, what controls allow access to relational data, and the new @Functions available to incorporate relational data in your Server Side JavaScript programming.
Framing the Argument: How to Scale Faster with NoSQLInside Analysis
The Briefing Room with Dr. Robin Bloor and IBM Cloudant
Live Webcast March 24, 2015
Watch the Archive: https://bloorgroup.webex.com/bloorgroup/onstage/g.php?MTID=e8bf62408d47e76c43aa73be08377e41c
Context matters. Perspective matters. Thinking outside the box? That's often the key! While the Structured Query Language remains the lingua Franca of data, there are some views of the world that are best rendered with the benefit of NoSQL engines. As usual, that's easier said than done. How can your organization migrate from a structured query to unstructured or semi-structured query language?
Register for this episode of The Briefing Room to find out! Veteran Analyst Dr. Robin Bloor will provide a detailed assessment of serious considerations when using NoSQL engines in conjunction with SQL. He'll be briefed by Ryan Millay of IBM Cloudant, who will showcase his company's solution, and how it's addressing the more vexing challenges facing today's information managers.
Visit InsideAnalysis.com for more information.
Microsoft released SQL Azure more than two years ago - that's enough time for testing (I hope!). So, are you ready to move your data to the Cloud? If you’re considering a business (i.e. a production environment) in the Cloud, you need to think about methods for backing up your data, a backup plan for your data and, eventually, restoring with Red Gate Cloud Services. In this session, you’ll see the differences, functionality, restrictions, and opportunities in SQL Azure and On-Premise SQL Server 2008/2008 R2/2012. We’ll consider topics such as how to be prepared for backup and restore, and which parts of a cloud environment are most important: keys, triggers, indexes, prices, security, service level agreements, etc.
NoSQL, as many of you may already know, is basically a database used to manage huge sets of unstructured data, where in the data is not stored in tabular relations like relational databases. Most of the currently existing Relational Databases have failed in solving some of the complex modern problems like:
• Continuously changing nature of data - structured, semi-structured, unstructured and polymorphic data.
• Applications now serve millions of users in different geo-locations, in different timezones and have to be up and running all the time, with data integrity maintained
• Applications are becoming more distributed with many moving towards cloud computing.
NoSQL plays a vital role in an enterprise application which needs to access and analyze a massive set of data that is being made available on multiple virtual servers (remote based) in the cloud infrastructure and mainly when the data set is not structured. Hence, the NoSQL database is designed to overcome the Performance, Scalability, Data Modelling and Distribution limitations that are seen in the Relational Databases.
Developing Connections Plug-ins and applications is full of "What the??" moments, from what browser technologies and versions are supported through to common functions working in different ways in different parts of Connections, any of these can put a real dent in your delivery date but most are easy to cure and avoid with a little bit of hindsight and knowledge, here is that knowledge for you to take home and help you deliver on time.
The presentation "Development for Administrators" was presented at AdminCamp 2006 in Germany, and a revised version presented at SoftSphere in Frankfurt in October 2007. This presentation intends to show Administrators:
Introduce proper development, UAT and production environments
show some basic @Formula language agents
Show some basic LotusScript functions
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
2. 2
Why Are We Here?
• What is the target audience?
Lotus Notes developers who use server-based agents
• What is this talk about?
Lotus Notes is often perceived as a data “silo” …
Difficult to get data into
And difficult to get data out of
… this is not the case
This presentation explores a multitude of ways of interfacing
Notes databases with enterprise relational databases
3. 3
Who Am I?
• Bill Buchan
• Dual Principal Certified Lotus Professional (PCLP) in v3,
v4, v5, v6, v7
• 10+ years senior development for Enterprise customers
Learn from my pain!
• 5+ years code auditing
• CEO of HADSL
Developing best-practice tools
5. 5
Overview
• This session:
Is mostly about code
Lots of take-home code examples
Is a deep-dive in terms of theory
6. 6
Connections: Overview
• “Lotus Notes cannot share its data with other
databases”
Absolutely not
Support for this dates back over 10 years!
• Multiple methods
This presentation leads you through some of the more
popular ones
Highlights the pros and cons of each
7. 7
Connections: Overview (cont.)
LSX LS:DO DCR JNDI/XML
Performance High Low Med High
ODBC Connection Required No Yes Yes No
Native Client Required Yes No No Yes
Platform Independent Yes Yes Yes Yes
LotusScript Only Yes Yes Yes No
Supported Yes No Yes Yes
Runs on Client Yes Yes Yes Yes
Runs on Server Yes Yes No Yes
8. 8
Tips: General
• In all of these examples, I shall hard-code user names
and passwords for simplicity
This is NOT a good production best practice!
Use encryption keys, profile documents, etc., to soft-code
these in production
• Any attempt by LotusScript to access data outside the
current database may result in error
Error handling is therefore mandatory
Logging of scheduled agents is mandatory
10. 10
Overview: LSX
• LotusScript-based
Such a small learning curve
• Relies on native client support
So you have to install your database client and/or drivers
• Is fast
This doesn’t have to use ODBC
But ODBC is used for MS SQL and Access
Remember, ODBC v2 doesn’t like Unicode
This technology is used in the Lotus Enterprise Integrator
Formerly “Notespump”
Good for bulk transfer-style applications
11. 11
Methodology
• We shall attempt to:
Test this against a local Access database using ODBC
Test this against an Oracle database
• Our data looks like:
• And for Access, we need an ODBC connection
12. 12
Demo: Read Table to Log
• Let’s get a feel for what we are doing
• In this demonstration, we will:
Connect, using ODBC, to an Access database
Collect all records in a CUSTOMERS table
Pull ALL fields from all records
Write all this information to a Notes log
14. 14
Architecture Design Goals
• When we write LSX applications, we should:
Write as little code as possible
Create comprehensive error handling
Create logs of both success and failure
Try not to hard-code the database structure
Try and reuse and componentize
After all, we might change databases later!
Ensure that our top-level logic is:
Focused on the business rules for data transfer
Is maintainable
After all, this will change!
15. 15
Architecture Design Overview
• In order to access data, we must:
Connect to the database provider
And then connect to the data itself
• Object-oriented LotusScript lends itself to this model
We shall create a:
baseClass: This handles logging
baseConnectionClass: This handles the connection to the
data source
baseConnection<DB>Class: These are database-specific
classes
Operation classes
These should NOT be database specific
16. 16
Architecture Design Results
• This means that we separate:
Logging
Basic connection
Operation
• Thus, reusing lots of code
• All database-specific code is held in a single library
Can be easily “swapped” for another
Platform and database differences can exist during our
operations
Test on the platform, version, and database that you will
implement on
17. 17
Class Inheritance and Code Use
BaseClass
BaseConnectionClass
BaseConnectionOracleClass
BaseConnectionODBCClass
ReadTableClass
Logging, Error Handling
Operations Class
Oracle-Specific Code
Logic for Connection
Code
Agent
ODBC-Specific Code
Example agent uses a
specific database
connection and one or
more helper function
classes
18. 18
Connecting to Oracle
• Now, let’s try connecting to Oracle
We need to:
Install the Oracle client
Connect it to the Oracle database server
19. 19
Some Oracle Tips
• Setting up an Oracle server is not trivial
Oracle is an enterprise-strength database system
As big, complex, and difficult as a dozen mother-in-laws
So give yourself time!
• Some tips:
The Connection string in Oracle looks like:
CUSTOMERS_oracle02.marykirk.local
This is:
The name of the application — in our case “Customers”
And then the network host address
Either as a Domain Name System (DNS) host address
or as an Internet Protocol (IP) address
20. 20
More Oracle Tips
• Try to use some Oracle tools to validate that you have:
A proper connection
Sufficient access to the application
Sufficient access to the tables
• Remember, you can use DCR to validate connections
21. 21
Network Architecture
• If you run Lotus Connector (LC) LSX code on the server:
The server must have:
A connection to Oracle
The Oracle Client software drivers
• If you run LC LSX code on the Notes client:
The client must have:
A connection to Oracle
The Oracle Client software
• Installing Oracle Client on all workstations is not trivial!
Consider using LC LSX on the servers only
22. 22
The Base Class
• Our base class
contains all
“Infrastructure”
support, such as:
Logging
Error trapping
Class baseClass
‘ returns true if this class is valid
Public Property Get Valid As Boolean
‘ Our constructor. Sets up logging
Sub new()
‘ Class destructor ensures proper closure of Log
Sub delete()
‘ Log a message
Public Function logEvent(msg As String) As Integer
‘ Handle run-time errors
Private Function raiseError() As String
End Class
23. 23
Class baseConnectorClass
' This class extends our BaseClass and adds the capability to open and close a connection
' Note that this is never used directly – and is overridden by our database-specific classes.
‘ This provides the business logic framework for our database specific connection classes
Class baseConnectorClass As BaseClass
‘ Expose some properties
Private Function getServer As String
Private Function getUserName As String
Private Function getPassword As String
Private Function getTable As String
Public Function getSession As LCSession
Public Function getConnection As LCConnection
' The base constructor for this class. Note that it doesnt actually
' do any connection work - it just sets up the base variables
Sub new(srv As String, un As String, pw As String, tb As String), baseClass()
‘ And the destructor. This ensures that the connection object is closed
Sub delete()
End Class
24. 24
Class baseODBCConnectorClass
• All of our business logic is held in baseConnectorClass
We need to put the database-specific code in only this class
In this case, it is all implemented in the constructor
• If we change the business logic later on:
We have to change only baseConnectorClass
' This class extends our BaseConnectorClass and adds the
‘ capabilty to open and close an ODBC Connection
Class baseODBCConnectorClass As BaseConnectorClass
‘ Supply a new constructor for this class
Sub new(srv As String, un As String, pw As String, tb As String)
End sub
25. 25
Insulating Database Connections from Business Logic
• One main goal is to insulate our database-specific
connection information from our business logic
It makes it easier to switch databases in the future, if
necessary
• In this database, I hold all database-specific information
in a profile document
Set docProfile = dbThis.GetProfileDocument("Profile")
Dim Connection As Variant
Select Case docProfile.Database(0)
Case "ODBC"
Set connection = New baseODBCConnectorClass _
(docProfile.System(0), "", "", "")
Case "Oracle"
Set connection = New baseOracleConnectorClass _
(docProfile.System(0), docProfile.UserName(0), docProfile.Password(0), docProfile.MetaData(0))
End Select
26. 26
Class fieldClass
• fieldClass
Helps us define which
fields we want returned
from our data object
Used to extract data
Class FieldClass
‘ Our two members – a name and a field
Public FieldName As String
Public Field As LCField
‘ get the value of this field
Property Get Value As Variant
‘ Construct this field class
Sub new(fName As String, F As LCField)
End Class
27. 27
Class baseODBCConnectorClass — Constructor
• This pseudo-code
shows the steps
towards connecting
to our LC LSX
target data server
• Differences from an
ODBC connection
The connection token
is “oracle8”
The username and
password are
specified
Set Me.lc_Session = New LCSession()
If ( Me.lc_Session.Status <> LCSUCCESS ) Then
‘ Bale out of the function…
‘ Check to see that the odbc2 LSX Support is available.
If (lc_Session.LookupConnector ("odbc2")) Then
…
‘ Now set up our Connection
Set me.lc_Connection = New LCConnection ( "odbc2" )
‘ Set up our data source name
Me.lc_Connection.Server = Me.getServer()
‘ And finally connect
Me.lc_Connection.Connect
‘ Check to see that the connection has worked
If (Me.lc_Connection.isConnected = False) Then
…
28. 28
ReadTableClass
• ReadTableClass
Allows us to read the result
of an SQL Query
Returns each table row as a
LIST of FieldClass items
Class ReadTableClass As baseClass
‘ Our constructor. Pass in our
‘ database connection object
Sub new(newConn As Variant)
' set up our read operation
‘ by passing in an SQL statemement
Public Function getRecords( _
strSelection As String) As Long
‘ Call this till it returns false, return
‘ each row of the table as a list
‘ of resulting fields
Public Function getNextRecord( _
index As Long, returnedFields _
List As FieldClass) As Integer
End Class
29. 29
Using ReadTableClass
• Our controlling code
Set up a database
connection
Create a ReadTableClass
object
Check to see whether
it’s valid
Run some SQL
Process the results
‘ set up our database connection
Set connection = New _
baseODBCConnectorClass( _
“CUSTOMERS”, "", "", "")
‘ set up our ReadTableClass object
Dim rc As New ReadTableClass(connection)
‘ Check to see its valid
If Not rc.Valid Then
…
‘ Do our SQL thing
If (rc.getRecords( _
"SELECT * from CUSTOMERS")) Then
While rc.getNextRecord(index, returnedValues)
…
30. 30
Processing the Results from ReadTableClass
• It’s a case of:
Retrieving each ROW of data
Iterating through the LIST of
fieldClass items and
processing them
• Agent “Read Tables to Log”
just prints them
Forall thisF In returnedValues
Call rc.logEvent(" " + thisF.fieldName + Space(30-Len(thisF.fieldName)) + _
Chr(9) +" [" + Cstr(thisF.Field.DataType) + "]" + Chr(9) + _
Implode(thisF.Field.Text, ", "))
End Forall
------------------ New Record retrieved ----------
ID 1
Name Lotus
Contact Mike R.hodin
Address Lotus House
City Westford
State MA
ZIP 90210
Country USA
dateFirstContact 01/01/1990 00:00:00
CreditLimit 5000000.0000
Employees 1000
…
31. 31
Demo: Read Table to Documents
• Let’s use the same underlying code:
Synchronize this information with Notes data
Use the ID field to match up SQL entries with Notes entries
For simplicity, we shall just overwrite the Notes data with
the SQL data
Note we are not requesting specific fields
We write ALL field information to a Notes database
We use the same field name in SQL and Notes
This might not be good in production
Consider pre-fixing the Notes field names to avoid
name collisions
33. 33
Let’s Write to SQL
• In this case, we need to define which fields we shall
update
This information is used to define:
The SQL target field
Which field in Notes we pull data from
The data type
This had better match the SQL data type!
Again, we want the operations class to do all the hard work!
34. 34
insertTablesClass
• Our class allows us to:
Define a series of field
names we shall write
data to
Pass a variant array of
values (in the same order
as our fields were
appended)
• This is still pretty hard
work
We have to track all
fields, etc.
Class InsertTableClass As baseClass
' Our constructor. Pass in the Connector.
Sub new(newConn As Variant)
' Call this for each field we wish to append,
‘ passing in a name and a type
Public Function appendField( _
fieldName As String, fieldType As Long) _
As Integer
' Commit to inserting these records.
' This returns the number of records successfully
‘ inserted, NOT true or false.
Public Function insertRecord( _
values() As Variant) As Integer
End Class
35. 35
insertFieldClass
• insertFieldClass
Helps define the
fields, field types,
and values to
transfer from the
Notes document to
the SQL table
For simplicity, in this
code instance we are
assuming that the
field names are
identical in Notes
and SQL
Class insertFieldClass
‘ Our constructor. Pass in our InsertTableClass
Sub new(newIT As Variant)
‘ Append a field name and an LSX field type
Public Function appendField( _
strName As String, Ltype As Long) As Integer
‘ Call this once you have set all your field names
Public Function setUpFields() As Integer
' Using our fieldList, save the field values
‘ from this document to to our InsertTableClass
Public Function saveFieldsFromDocument( _
doc As NotesDocument) As Integer
End Class
36. 36
insertTableClass and insertFieldClass Usage
• Define a new
InsertTableClass
• Define a new
InsertFieldClass
• Define our fields
• Freeze the definition
• Push the data
‘ Create a new InsertTable Class
Dim it As New InsertTableClass(Connection)
‘ And create a InsertFieldClass, associating
‘ it with our table Class.
Dim ic As New InsertFieldClass(IT)
‘ Define the fields
Call ic.appendField("ID", LCTYPE_NUMERIC)
Call ic.appendField("Name", LCTYPE_TEXT)
…
‘ And “freeze” it there.
Call ic. setUpFields()
‘ And for one or more Documents, push the
‘ Data across.
Call ic.saveFieldsFromDocument(doc)
38. 38
Performance
• Creating LCField items is expensive
We define our LCFields before inserting data
Instead of creating new LCField items within the loop for
each iteration, we create them ONCE outside the loop and
reuse them
Adds slightly to the complexity
Hence the requirement for insertFieldsClass
40. 40
Introducing LotusScript Data Object (LS:DO)
• LS:DO was the first data interface
And is reportedly no longer supported
You may find some code that still relies on this
• LS:DO uses ODBC v2 drivers to access data
You cannot access Unicode data
This was introduced in ODBC v3.5
The client must have an ODBC definition for the target data
source on his machine, if you are running client-based code
• Let’s dive straight into a demo …
42. 42
Using LS:DO
• Create a new connection
• Create a query and link it to our
connection
• Create a result set and connect it
to our query
• Set the SQL query
• Execute the query
Const SQL_TABLE = "CUSTOMERS"
Const SQL_QUERY =
"SELECT * FROM CUSTOMERS"
Set Connection = New ODBCConnection
Connection.ConnectTo(SQL_TABLE)
If Not Connection.IsConnected Then
…
Dim Query As New ODBCQuery
Set Query.Connection = Connection
Dim Result As New ODBCResultSet
Set Result.Query = Query
Query.SQL = SQL_QUERY
Result.Execute
43. 43
LS:DO Result Set Processing
• The ODBCResultSet Object now contains all the results
You can extract field information
You can extract actual values
This code extracts field name and size information
If Not Result.IsResultSetAvailable Then
Messagebox "I failed to get results from SQL Query: “ + _
SQL_QUERY, 48, "Failed to get Results"
Exit Sub
End If
Dim fields List As String
Dim i As Integer
For i = 1 To Result.NumColumns
Print "Field: " + padString( result.FieldName(i), 30) + _
"Size: " + padString(Cstr(Result.FieldSize(i)), 5)
fields(result.FieldName(i)) = result.FieldName(i)
Next
44. 44
LS:DO Result Set Processing (cont.)
• To extract the result rows themselves, use:
Result.getNextRow
Result.IsEndOfData
ID 1
Name Lotus
Contact Mike R.hodin
Address Lotus House
City Westford
State MA
ZIP 90210
Country USA
dateFirstContact 01/01/1990
CreditLimit 5000000
Employees 1000
While Not result.IsEndOfData
Forall thisField In fields
Print " " & padString( "" + thisField, 30 ) & Chr(9) & Result.GetValue(thisField)
End Forall
Call Result.NextRow()
Wend
45. 45
LS:DO Tips
• LS:DO supports transaction processing
You could — if your SQL data source allowed — switch on
Transaction mode
odbcConnection.IsSupported(DB_SUPP_TRANSACTIONS)
You could then perform multiple updates
Commit them all at once
odbcConnection.CommitTransactions
46. 46
LS:DO Summary
• LS:DO was a fairly simple, robust ODBC connection
You might have some code that relies on it
• I would advise you to:
Identify any code that relies on LS:DO
Refactor that code to use LSX
48. 48
Introducing DCR
• Data Connection Resources (DCR)
New in Domino 6
Allows you to perform real-time, user-based SQL database
access
Very useful for front-end applications
• However:
It requires constant access to the target database
It requires Domino Enterprise Connection Services (DECS)
Running on the server on which your application is hosted
It pools all SQL database access via the DECS server
49. 49
Create a New Shared Resource — Data Connection
• Set a name and alias
• Set the data connection type
• Enter username and password, if required
• Choose the data source
• And choose the object
• Use Browse metadata
to validate the connection
50. 50
Link the Data Source to Your Form
• On the Form Properties — advanced tab, click Browse
Choose the data connection and the metadata object
51. 51
Link the Fields to the Data
• On the field properties:
Check “External data source”
At the bottom, use the Browse
button to select the data source,
metadata
• One field needs to be defined as
the key field
• Remember to check “Store data
locally” if you want to see this
data on views!
52. 52
DCR: What Would I Use It For?
• Very useful for:
Applications that are permanently connected
Applications that require instant lookup of external data
• You could use Notes information and …
Perform lookups to populate the document
Update status information on user request
53. 53
Form Manipulation
• Bear in mind that all this logic is held on the Form
design element
You could use one Form to populate/refresh data
And allow users to work another Form
Which just displays the data on the document
54. 54
Demo: DCR
• In this demo, I will:
Demonstrate data being updated in Notes and pushed to SQL
Demonstrate data being updated in SQL and pushed to Notes
Show you the DCR common element, as well as the Field
definition
57. 57
Resources
• Constantin Florea, Notes and Domino Connectivity: A
Collection of Examples (IBM Redpaper, March 2001).
www.redbooks.ibm.com/redpapers/pdfs/redp0115.pdf
Check out the abstract here:
www.redbooks.ibm.com/abstracts/redp0115.html?Open
• Brian Benz and Rocky Oliver, Lotus Notes and Domino 6
Programming Bible (Wiley, 2003).
www.amazon.com/gp/product/0764526111
59. 59
7 Key Points to Take Home
• Domino can easily interact with other data sources
• LS:DO, whilst powerful and easy to use – is no longer
supported
Consider refactoring this
• LSX performs bulk updates between Domino and other
data sources
Simple, fast, efficient
• DCR allows real-time update in user context
And centralizes data lookup via the server
60. 60
7 Key Points to Take Home (cont.)
• Consider that the target data source will change
• Logging and error trapping
Mandatory
Ensure that you know of issues before your users
Monitor this interface
• This interface code will change often
Write for maintainability!