2017 Sep 06 10:41 PM
Hello all,
I'm developer and I have a question about jdbc connection HANA.
I have followed this documentation for my tests :
My HANA system is in multiple-database and scale-out with replication.
I have tested two method connection :
public class HanaUtil {
public static Connection getConnectionFirstMethod() throws Exception {
Properties p = new Properties();
p.setProperty("autocommit", "false");
p.setProperty("user", "****");
p.setProperty("password", "****");
p.setProperty("databaseName", "****");
String uri = "jdbc:sap://localhost:30513";
Connection connection = DriverManager.getConnection(uri, p);
return connection;
}
public static Connection getConnectionSecondMethod() throws Exception {
Properties p = new Properties();
p.setProperty("autocommit", "false");
p.setProperty("user", "****");
p.setProperty("password", "****");
String uri = "jdbc:sap://localhost:30544";
Connection connection = DriverManager.getConnection(uri, p);
return connection;
}
}
Both methods works but, depending on the method called, I didn't have the same result for my request SQL : (and others)
"select * from SYS.M_DATABASES"
And I would know why, and which method is the best pratice.
Thank a lot
F.Serkan
Hello all,
I'm developer and I have a question about jdbc connection HANA.
I have followed this documentation for my tests :
My HANA system is in multiple-database and scale-out with replication.
I have tested two method connection :
public class HanaUtil {
public static Connection getConnectionFirstMethod() throws Exception {
Properties p = new Properties();
p.setProperty("autocommit", "false");
p.setProperty("user", "****");
p.setProperty("password", "****");
p.setProperty("databaseName", "****");
String uri = "jdbc:sap://localhost:30513";
Connection connection = DriverManager.getConnection(uri, p);
return connection;
}
public static Connection getConnectionSecondMethod() throws Exception {
Properties p = new Properties();
p.setProperty("autocommit", "false");
p.setProperty("user", "****");
p.setProperty("password", "****");
String uri = "jdbc:sap://localhost:30544";
Connection connection = DriverManager.getConnection(uri, p);
return connection;
}
}
Both methods works but, depending on the method called, I didn't have the same result for my request SQL : (and others)
"select * from SYS.M_DATABASES"
And I would know why, and which method is the best pratice.
Thank a lot
F.Serkan
2017 Sep 06 10:41 PM
2017 Sep 08 3:12 PM
2017 Sep 08 7:27 PM
2017 Sep 12 4:44 PM