opensap hanacloud1-1 week 02 persistency basics

55
Week 2 Unit 1: Introduction and First Steps with EJB May, 2014

Upload: muhammad-nadeem

Post on 07-Feb-2016

38 views

Category:

Documents


0 download

DESCRIPTION

SAPWeek2

TRANSCRIPT

Page 1: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Week 2 Unit 1: Introduction and

First Steps with EJB

May, 2014

Page 2: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 2 Public

Introduction and First Steps with EJB Persistence as a Service

Manages the database systems in the

cloud and the access to them

Operations on database system level

Monitoring and alerting

Load balancing and scaling

Backup and recovery

Configuration

Metering

Application data isolation

Page 3: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 3 Public

Introduction and First Steps with EJB Easy Consumption

Standards-based access

JDBC

JPA 2.0

Choice of database platform

SAP HANA

SAP MaxDB

Apache Derby (for local development)

Schema management

One schema per application (default)

Many applications sharing one schema

One application using many schemas

Schema management available in cockpit

Page 4: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 4 Public

Introduction and First Steps with EJB Java Persistence API (JPA)

Describes management of relational

data in applications

Replaces persistence solution for

EJB 2.0 CMP

Default support in SAP HANA Cloud

Platform runtimes for JPA 2.0

Page 5: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 5 Public

Introduction and First Steps with EJB EJB Sample

Makes use of Java EE 6 Web Profile

(SAP HANA Cloud Platform SDK 2.x)

Web container

EJB container

Persistence provider - EclipseLink

DB

PersistenceWithEJBServlet

PersonBean

Person EclipseLink as

persistence provider

EJB Container

Web Container

Java EE 6 Web Profile (2.x)

Schemas

JDBC

Page 6: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 6 Public

Introduction and First Steps with EJB EJB Sample

Import to Eclipse as

‘Existing Projects into Workspace’

Location:

<SDK_path>\samples\persistence-with-ejb

Page 7: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 7 Public

Introduction and First Steps with EJB EJB Sample

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

Page 8: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 8 Public

Introduction and First Steps with EJB EJB Sample

Run the sample

– ‘Run on Server’

Configure SAP HANA Cloud Server

– hanatrial.ondemand.com

Request URL

– https://<application_name><account_name>.ha

natrial.ondemand.com/persistence-with-ejb/

Page 9: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 9 Public

Introduction and First Steps with EJB EJB Sample

SAP HANA Cloud Platform cockpit

provides the following information in

the ‘Database Schemas’ view:

Schema name/ID

Database type

Application bindings

Page 10: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 10 Public

Introduction and First Steps with EJB What You’ve Learned in This Unit

The role of Persistence Service

on SAP HANA Cloud Platform

The supported database platform

types

How applications can store data

in a database in the cloud

JPA, and how it is supported on

SAP HANA Cloud Platform

What a persistence-enabled EJB

application looks like

Where to find information about

your schema

Page 11: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Contact information:

[email protected]

Thank you

Page 12: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 12 Public

© 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.

National product specifications may vary.

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.

Page 13: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Week 2 Unit 2:

Connecting to Your Database

May, 2014

Page 14: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 2 Public

Connecting to Your Database How to Connect to My Database in the Cloud

Scenario:

App developer wants to connect to

database in the cloud via JDBC tool

Database in the cloud is not publicly

accessible

How to do it:

Use Eclipse IDE plug-ins:

SAP HANA Cloud Platform Tools for

connecting to SAP HANA systems

SAP HANA Tools

Eclipse IDE

+ SAP HANA Tools

DB

SAP HANA Cloud Platform

DB Tunnel over SSL

Schema

Page 15: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 3 Public

Connecting to Your Database Procedure

Open Perspective:

SAP HANA Administration

Console

Add Cloud System

Select Trial Instances option

Choose the instance you want

to work with

Page 16: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 4 Public

Connecting to Your Database Finding Your Application Data

DEV_<GUID> - the schema for the

automatically generated developer

user

NEO_<GUID> - the schema used by

the application

T_PERSONS – the table created by

the application

Page 17: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 5 Public

Connecting to Your Database What You’ve Learned in This Unit

How to connect to your database in

the cloud

What the additional tools are that

should be installed in Eclipse IDE to

support this scenario

Operations on application data that

can be performed from the SAP HANA

Tools plug-in

Page 18: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Contact information:

[email protected]

Thank you

Page 19: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 7 Public

© 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.

National product specifications may vary.

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.

Page 20: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Week 2 Unit 3:Creating a JDBC ApplicationOctober, 2013

Page 21: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 2Public

Creating a JDBC ApplicationJDBC Overview

Java Database Connectivity (JDBC)Java-based data access technologyDefines how a client can connect,query, and update data in a database

JDBC APIJDBC connections support creation andexecution of statementsResultSet presents the outcome after astatement has been executed

Page 22: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 3Public

Creating a JDBC ApplicationWhy Use JDBC?

Advantages of JDBCClean and easy for small applicationsGood performance with large amountsof dataAllows optimization of SQL requestsReuse of existing JDBC libraries(Liquibase, Hibernate)

Disadvantages of JDBCLarge programming overhead for largeprojectsConcurrency support and transactionand connection management requiredInitial creation of database structuresrequired

Page 23: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 4Public

Creating a JDBC ApplicationJDBC Sample

Uses standard database access(JDBC)

Needs only a Web container, so canrun in both runtimes

Java Web (1.x)Java EE 6 Web Profile (2.x)

PersistenceWithEJBServlet

PersonDAO

Person

Web Container

Java EE 6 Web Profile (2.x) orJava Web (1.x)

SchemasDB

JDBC

Page 24: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 5Public

Creating a JDBC ApplicationJDBC Sample

Import to Eclipse as‘Existing Projects into Workspace’Location:<SDK_path>\samples\persistence-with-jdbc

Page 25: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 6Public

Creating a JDBC ApplicationJDBC Sample

Building Blocks:Person.javaholds the information for a person

PersonDAO.javaperforms all operations with DB

PersistenceWithJDBCServlet.javaprovides interaction with the end users andlooks up the DataSource from JNDI

web.xmlweb application descriptor; definesdatasource resource

Page 26: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 7Public

Creating a JDBC ApplicationJDBC Sample

Run the sample– ‘Run on Server’

Configure SAP HANA Cloud Server– hanatrial.ondemand.com

Request URL– https://<application_name><account_name>.

hanatrial.ondemand.com/persistence-with-jdbc/

Page 27: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 8Public

Creating a JDBC ApplicationJDBC Sample

In the background:A new schema is createdSchema is bound to the applicationWhen app requests data source the appgets connected to this schema– Maximum 8 parallel database connections per

schema

When application is undeployed, theschema is not removedWhen application is redeployed, it usessame schema and bindings

Page 28: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 9Public

Creating a JDBC ApplicationHow Can I See the SQL Statements Sent to the Database?

SQL TraceProvides a log of selected SQLstatementsRelevant for both JPA and JDBCapplicationsIntegrated in the standard trace logfilesDisabled by default

ScenariosInvestigate database access-relatedperformance issuesDetermine inefficient SQL statements

Page 29: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 10Public

Creating a JDBC ApplicationHow to Enable the SQL Trace

Set the log level of “com.sap.core.persistence.sql.trace” to DEBUG

Tools:Eclipse IDESAP HANA Cloud Platform Cockpit

Page 30: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 11Public

Creating a JDBC ApplicationHow to Read SQL Trace Records

The SQL trace is written in the default trace log fileFile name prefix ljs_trace_vsa

Tools:Eclipse IDESAP HANA Cloud Platform Cockpit

Page 31: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 12Public

Creating a JDBC ApplicationWhat You’ve Learned in This Unit

What JDBC isThe advantages and disadvantagesof JDBCWhat a persistence-enabled JDBCapplication looks likeWhat happens in the backgroundwhen an application is deployed andstartedHow to trace the SQL statementsperformed by your applicationHow to enable, disable, and displaythe SQL trace recordings

Page 32: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Contact information:

[email protected]

Thank you

Page 33: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 14Public

© 2013 SAP AG. 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.The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation orwarranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Groupproducts and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothingherein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG inGermany and other countries.Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Page 34: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Week 2 Unit 4:Sharing Data Between ApplicationsOctober, 2013

Page 35: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 2Public

Sharing Data Between ApplicationsHow Can I Share Data Between Applications?

Scenario:Multiple applications need to work withthe same data

Auto-generated schemasNew schema is automatically createdfor application on first startApplication is bound to the schemawith default data-source binding

SAP HANA databasesystems

Application2

Application1

Auto-bound

<DEFAULT>

Data source

Auto-bound

<DEFAULT>

Data source

Auto-generatedschema2

Auto-generatedschema1

Page 36: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 3Public

Sharing Data Between ApplicationsSharing Schemas

A schema can be shared betweenapplications by binding it to morethan one application

Steps:Unbind the schema from theapplicationBind the application to the otherschema with <DEFAULT> data-sourcebindingRestart the application

SAP HANA databasesystems

Application2

Application1

Auto-bound

<DEFAULT>

Data source

Auto-bound

<DEFAULT>

Data source

Auto-generatedschema2

Auto-generatedschema1

Page 37: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 4Public

Sharing Data Between ApplicationsTools: SAP HANA Cloud Platform Cockpit

Database Schema ViewsOperations:– list all schemas in account– show bindings per schema– delete existing binding– create new binding– delete schema

Applications -> DashboardOperations:– restart application

Page 38: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 5Public

Sharing Data Between ApplicationsTools: SDK Console Commands

Open a command window in the ‘<SDK>/tools’ folder and set proxy settings ifneeded

list-schemasneo list-schemas -h <host> -u <user> -a <account>

display-schema-infoneo display-schema-info -h <host> -u <user> -a <account> --id <schema id>

unbind-schemaneo unbind-schema -h <host> -u <user> -a <account> -b <application>

bind-schemaneo bind-schema -h <host> -u <user> -a <account> -b <application> --id<schema id>

Page 39: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 6Public

Sharing Data Between ApplicationsDemo

Scenario: Configure the JDBC sampleto use the same data as the EJB sample

No code change is neededUnbind the JDBC sample applicationfrom its schemaBind it to the schema of the EJB sampleRestart the JDBC sample applicationRequest it

SAP HANA databasesystems

JDBC Sample

EJB Sample

Auto-bound

<DEFAULT>

Data source

Auto-bound

<DEFAULT>

Data source

jdbc sampleschema

ejb sample schema

Page 40: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 7Public

Sharing Data Between ApplicationsWhat You’ve Learned in This Unit

What auto-generated schemas areWhat default data-source binding isHow to bind a schema to anapplicationHow to remove the binding betweenan application and a schemaHow to share data betweenapplications

Page 41: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Contact information:

[email protected]

Thank you

Page 42: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2013 SAP AG. All rights reserved. 9Public

© 2013 SAP AG. 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.The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation orwarranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Groupproducts and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothingherein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG inGermany and other countries.Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Page 43: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Week 2 Unit 5:

Using Multiple Databases

May, 2014

Page 44: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 2 Public

Using Multiple Databases How Can I Use Multiple Schemas in My Application?

Scenario:

You want your application to store data

in multiple schemas

Auto-generated schemas

One schema per application

Database type (default account

setting)

Default data-source binding

Auto-bound

<DEFAULT>

Data source

SAP HANA database systems

Application2

Application1

Auto-bound

<DEFAULT>

Data source

SAP MaxDB database

systems

Auto-generated

schema

Auto-generated

schema

Page 45: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 3 Public

Using Multiple Databases How to Use Multiple Schemas in an Application

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

6. Re-deploy the application

Page 46: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 4 Public

Using Multiple Databases Demo: Scenario

Enhance the JDBC sample to use a

second schema of type MaxDB

Auto-generated

schema

SAP HANA database systems

JDBC Sample

maxdb schema

SAP MaxDB database systems

‘jdbc/MaxDB’

Data source

‘jdbc/DefaultDB’

Data source

Page 47: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 5 Public

Using Multiple Databases Demo: Code Changes

Declare additional resource reference

in web.xml

<resource-ref>

<res-ref-name>jdbc/MaxDB</res-ref-name>

<res-type>javax.sql.DataSource</res-type>

</resource-ref>

Page 48: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 6 Public

Using Multiple Databases Demo: Code Changes

Create a new method in ‘PersistenceWithJDBCServlet‘ that looks up a data

source by name and returns the database product information

private String getDatabaseNameAndVersion(String dataSourceName) throws NamingException, SQLException { InitialContext ctx = new InitialContext(); DataSource dataSource = (DataSource) ctx.lookup(dataSourceName); Connection connection = null; try { connection = dataSource.getConnection(); DatabaseMetaData metaData = connection.getMetaData(); return metaData.getDatabaseProductName() + " " + metaData.getDatabaseProductVersion(); } finally { if (connection != null) connection.close(); } }

Page 49: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 7 Public

Using Multiple Databases Demo: Code Changes

Invoke the new method ‘PersistenceWithJDBCServlet’ in doGet(…) to

display the database product information in the UI for both the ‘jdbc/MaxDB’

and ‘jdbc/DefaultDB’ data sources

response.getWriter().println("<p>The MaxDB data source is connected to " + getDatabaseNameAndVersion("java:comp/env/jdbc/MaxDB") + "</p>"); response.getWriter().println("<p>The DefaultDB data source is connected to " + getDatabaseNameAndVersion("java:comp/env/jdbc/DefaultDB") + "</p>");

Page 50: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 8 Public

Using Multiple Databases Demo: Configuration Changes

Create a new schema of type MaxDB

visible to all apps in the account

Choose a unique schema name

Choose the database type SAP

MaxDB

Tools

SAP HANA Cloud Platform cockpit

Console client command

neo create-schema -h <host> -u <user> -a

<account> --id<schema id> -d <db type>

Page 51: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 9 Public

Using Multiple Databases Demo: Configuration Changes

Unbind the default data-source

binding

Bind the new MaxDB schema with

data-source name ‘jdbc/MaxDB‘

Bind the old SAP HANA schema with

data-source names

– jdbc/DefaultDB

– jdbc/defaultManagedDataSource

– jdbc/defaultUnmanagedDataSource

my_hana

schema

Auto-bound

<DEFAULT>

Data source

Auto-generated

schema

SAP HANA database systems

JDBC Sample

my_maxdb

schema

SAP MaxDB database systems

Page 52: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 10 Public

Using Multiple Databases Demo: Results

Restart the JDBC sample application

Request it

Check the UI for the new entries showing the database product name and

version

Page 53: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 11 Public

Using Multiple Databases What You’ve Learned in This Unit

How an application can use multiple

schemas

How to create a schema

How to bind multiple schemas to an

application

Which additional data-source

bindings must be created if the

application uses Java EE Web

Profile 2.X

Page 54: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

Contact information:

[email protected]

Thank you

Page 55: OpenSAP HANACLOUD1-1 Week 02 Persistency Basics

© 2014 SAP AG or an SAP affiliate company. All rights reserved 13 Public

© 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.

National product specifications may vary.

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.