String databaseURL = "jdbc:sap://<HOST_NAME>:30015/<DATABASE_NAME>";
Class.forName("com.sap.db.jdbc.Driver");
Connection conn = DriverManager.getConnection(databaseURL, <user><password>);
Я использую ngdbc-2.3.48.jar.Соединение устанавливается с помощью пользовательского интерфейса в Eclipse.
Но не из приведенного выше кода.Давая ниже исключения:
com.sap.db.jdbc.exceptions.SQLInvalidAuthorizationSpecExceptionSapDB: [10]: authentication failed
at com.sap.db.jdbc.exceptions.SQLExceptionSapDB._newInstance(SQLExceptionSapDB.java:165)
at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.newInstance(SQLExceptionSapDB.java:42)
at com.sap.db.jdbc.packet.HReplyPacket._buildExceptionChain(HReplyPacket.java:977)
at com.sap.db.jdbc.packet.HReplyPacket.getSQLExceptionChain(HReplyPacket.java:158)
at com.sap.db.jdbc.packet.HPartInfo.getSQLExceptionChain(HPartInfo.java:40)
at com.sap.db.jdbc.ConnectionSapDB._receive(ConnectionSapDB.java:3115)
at com.sap.db.jdbc.ConnectionSapDB.exchange(ConnectionSapDB.java:1518)
at com.sap.db.util.security.AbstractAuthenticationManager.connect(AbstractAuthenticationManager.java:41)
at com.sap.db.jdbc.ConnectionSapDB._getNewSession(ConnectionSapDB.java:3496)
at com.sap.db.jdbc.ConnectionSapDB._getNewConnection(ConnectionSapDB.java:2813)
at com.sap.db.jdbc.ConnectionSapDB.<init>(ConnectionSapDB.java:198)
at com.sap.db.jdbc.HanaConnection.<init>(HanaConnection.java:39)
at com.sap.db.jdbc.HanaConnectionFinalize.<init>(HanaConnectionFinalize.java:36)
at com.sap.db.jdbc.HanaConnectionFinalize.newInstance(HanaConnectionFinalize.java:23)
at com.sap.db.jdbc.DriverSapDB._createConnection(DriverSapDB.java:1445)
at com.sap.db.jdbc.Topology.getConnection(Topology.java:200)
at com.sap.db.jdbc.DriverSapDB._connect(DriverSapDB.java:1400)
at com.sap.db.jdbc.DriverSapDB.connect(DriverSapDB.java:1102)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.test(HANATest.java:429)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Пожалуйста, помогите мне с строкой подключения.