cancel
Showing results for 
Search instead for 
Did you mean: 

I want to connect SAP HANA database (Default database) using JDBC connection URL.

Former Member
0 Kudos

I am using trial account .at sap cloud server.

What will be my URL of SAP HANA database for Trail account.

For ex:

java.sql.Connection conn= java.sql.DriverManager.getConnection("jdbc:sap://<YOUR SAP HANA IP>:host","<YOUR SAP HANA USER>","<YOUR PASSWORD>");

I had User and password but what supposed to be used in place of IP and Host ?

Accepted Solutions (1)

Accepted Solutions (1)

Vlado
Advisor
Advisor
0 Kudos

You don't use DriverManager, instead you should use a DataSource. See Using Plain JDBC.

Former Member
0 Kudos

Thanks .But iwant to use like this ..and below properties are not working

repliesd as connectin refused -813

please help onthis

<bean id="dataSource"

      class="org.springframework.jdbc.datasource.DriverManagerDataSource">

      <property name="driverClassName" value="com.sap.db.jdbc.Driver"/>

      <property name="url" value="jdbc:sap://localhost:30015/?currrentschema=TestSchema" />

      <property name="username" value="p1940828544"/>

      <property name="password" value="Vivek@cgt.co.in"/>

   </bean>

Vlado
Advisor
Advisor
0 Kudos

If you really need the connection details for this kind of configuration, you could open a DB tunnel and use the returned values. However, keep in mind that for trial instances the tunnel is closed and the password invalidated after 24 hours.

Former Member
0 Kudos

Thanks for reply  ,I.

I was following below step: and not working .

1.Get the details from Open db tunnel

2. close the tunnel.

3. set the parameter  in config file

4. run the application

5. connection refused at localhost:30015  -813

Should i close the database instance in SAP administrator console from eclipse IDE.

Vlado
Advisor
Advisor
0 Kudos

Of course you must *not* close the tunnel or instance while the application is running. It is needed to establish and keep the connection open.

Answers (0)