Open Sap
Open Sap
Open Sap
Standards-based access
JDBC
JPA 2.0
Schema management
One schema per application (default)
Many applications sharing one schema
One application using many schemas
Schema management available in cockpit
Web container
EJB container Web Container
PersistenceWithEJBServlet
Persistence provider - EclipseLink
EJB Container
PersonBean
EclipseLink as
Person persistence provider
JDBC
DB
Schemas
Import to Eclipse as
‘Existing Projects into Workspace’
Location:
<SDK_path>\samples\persistence-with-ejb
Building Blocks:
Person.java
persistence entity
PersonBean.java
stateless bean
persistence.xml
JPA configuration file
PersistenceWithEJBServlet.java
provides interaction with end users
web.xml
Web application descriptor
open@sap.com
© 2014 SAP AG or an SAP affiliate company.
All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP AG or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP AG or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP AG or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP AG or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP AG’s or its affiliated
companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP AG or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
Eclipse IDE
Scenario: + SAP HANA Tools
App developer wants to connect to
database in the cloud via JDBC tool
Database in the cloud is not publicly
accessible
Open Perspective:
SAP HANA Administration
Console
open@sap.com
© 2014 SAP AG or an SAP affiliate company.
All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP AG or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP AG or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP AG or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP AG or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP AG’s or its affiliated
companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP AG or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
JDBC API
JDBC connections support creation and
execution of statements
ResultSet presents the outcome after a
statement has been executed
Advantages of JDBC
Clean and easy for small applications
Good performance with large amounts
of data
Allows optimization of SQL requests
Reuse of existing JDBC libraries
(Liquibase, Hibernate)
Disadvantages of JDBC
Large programming overhead for large
projects
Concurrency support and transaction
and connection management required
Initial creation of database structures
required
DB Schemas
Import to Eclipse as
‘Existing Projects into Workspace’
Location:
<SDK_path>\samples\persistence-with-jdbc
Building Blocks:
Person.java
holds the information for a person
PersonDAO.java
performs all operations with DB
PersistenceWithJDBCServlet.java
provides interaction with the end users and
looks up the DataSource from JNDI
web.xml
web application descriptor; defines
datasource resource
In the background:
A new schema is created
Schema is bound to the application
When app requests data source the app
gets connected to this schema
– Maximum 8 parallel database connections per
schema
When application is undeployed, the
schema is not removed
When application is redeployed, it uses
same schema and bindings
SQL Trace
Provides a log of selected SQL
statements
Relevant for both JPA and JDBC
applications
Integrated in the standard trace log
files
Disabled by default
Scenarios
Investigate database access-related
performance issues
Determine inefficient SQL statements
Tools:
Eclipse IDE
SAP HANA Cloud Platform Cockpit
Tools:
Eclipse IDE
SAP HANA Cloud Platform Cockpit
What JDBC is
The advantages and disadvantages
of JDBC
What a persistence-enabled JDBC
application looks like
What happens in the background
when an application is deployed and
started
How to trace the SQL statements
performed by your application
How to enable, disable, and display
the SQL trace recordings
open@sap.com
© 2014 SAP SE or an SAP affiliate company.
All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated
companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
Scenario:
Multiple applications need to work with
the same data Application1
Auto-bound
Auto-generated schemas
Application2 <DEFAULT>
New schema is automatically created Data source
for application on first start
Auto-bound
Application is bound to the schema <DEFAULT>
with default data-source binding Data source
Auto-generated
schema1
Auto-generated
schema2
Steps:
Auto-bound
Unbind the schema from the Application2 <DEFAULT>
application Data source
Auto-generated
schema2
Open a command window in the ‘<SDK>/tools’ folder and set proxy settings if
needed
list-schemas
neo list-schemas -h <host> -u <user> -a <account>
display-schema-info
neo display-schema-info -h <host> -u <user> -a <account> --id <schema id>
unbind-schema
neo unbind-schema -h <host> -u <user> -a <account> -b <application>
bind-schema
neo bind-schema -h <host> -u <user> -a <account> -b <application> --id<schema id>
Request it Auto-bound
<DEFAULT>
Data source
jdbc sample
schema
open@sap.com
© 2014 SAP SE or an SAP affiliate company.
All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP SE or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP SE or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated
companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.
Scenario: Application1
You want your application to store data
Auto-bound
in multiple schemas Application2 <DEFAULT>
Data source
Auto-generated
schema
Steps:
1. Prepare the application
2. Create schemas
3. Unbind the auto-generated
schema
4. Bind the application to the other
schemas using declared data-
source names
5. For Java EE Web Profile 2.X,
also create bindings to
– jdbc/defaultManagedDataSource
– jdbc/defaultUnmanagedDataSource
‘jdbc/DefaultDB’
Data source
Auto-generated
schema
‘jdbc/MaxDB’
Data source
maxdb schema
Tools
SAP HANA Cloud Platform cockpit
Console client command
neo create-schema -h <host> -u <user> -a
<account> --id<schema id> -d <db type>
my_maxdb
schema
Request it
Check the UI for the new entries showing the database product name and
version
open@sap.com
© 2014 SAP AG or an SAP affiliate company.
All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG or an
SAP affiliate company.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG
(or an SAP affiliate company) in Germany and other countries. Please see http://global12.sap.com/corporate-en/legal/copyright/index.epx for additional
trademark information and notices.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
These materials are provided by SAP AG or an SAP affiliate company for informational purposes only, without representation or warranty of any kind,
and SAP AG or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP AG or
SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an additional warranty.
In particular, SAP AG or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related
presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP AG’s or its affiliated
companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be
changed by SAP AG or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment,
promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties
that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking
statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.