Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Error: "invalid schema name" even if schema is present in the database in SAP HANA

I am connecting to HANA database from a JAVA application using JDBC driver. I am getting an error: "invalid schema name" even if schema is present in the database.

SQL query is executing fine from HANA Studio, anyone else faced the same error?

Below is the error code −

com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [362] (at 2278): invalid schema name: xxxxxxxxxxxxxxxxxxxxx


1 Answer
SAP Expert

I think you need to mention database name in JDBC URL while connecting to the database. Try following −

String server = "servername.domain.com";
String instance = "03";
String database = "TEST";
String dbUsername = "USERNAME";
String dbPassword = "xxxxxx";
String jdbcUrl = "jdbc:sap://" + server + ":3" + instance + "15/?currentschema=" + database + "&user=" + dbUsername + "&password=" + dbPassword;
java.sql.Connection connection = java.sql.DriverManager.getConnection(jdbcUrl);

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.