0 Replies Latest reply on Sep 26, 2018 6:19 AM by 3146278

    java.sql.SQLException: [TimesTen]Cannot find the requested DSN (ormb_ttdb) in ODBCINI /var/TimesTen/tt1122/sys.odbc.ini or /var/TimesTen/sys.odbc.ini

    3146278

      I have setup a Timesten client(11.2.2.8.0) on my unix machine.

      I have setup a Timesten server on different machine.

      After setup is complete I am trying to connect to Timesten database using JDBC from my spark code written in java.

      I am getting below exception :

      Exception in thread "main" java.sql.SQLException: [TimesTen][TimesTen 11.2.2.8.0 CLIENT]Cannot find the requested DSN (ormb_ttdb) in ODBCINI /var/TimesTen/tt1122/sys.odbc.ini or  /var/TimesTen/sys.odbc.ini at com.timesten.jdbc.JdbcOdbc.createSQLException(JdbcOdbc.java:3237) at com.timesten.jdbc.JdbcOdbc.standardError(JdbcOdbc.java:3386) at com.timesten.jdbc.JdbcOdbc.standardError(JdbcOdbc.java:3351) at com.timesten.jdbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:800) at com.timesten.jdbc.JdbcOdbcConnection.connect(JdbcOdbcConnection.java:1866) at com.timesten.jdbc.TimesTenDriver.connect(TimesTenDriver.java:305) at com.timesten.jdbc.TimesTenDriver.connect(TimesTenDriver.java:161) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$1.apply(JdbcUtils.scala:63) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$createConnectionFactory$1.apply(JdbcUtils.scala:54) at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:63) at org.apache.spark.sql.execution.datasources.SaveIntoDataSourceCommand.run(SaveIntoDataSourceCommand.scala:46) at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:70) at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:68) at org.apache.spark.sql.execution.command.ExecutedCommandExec.doExecute(commands.scala:86) at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:131) at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:127) at org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:155) at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151) at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:152) at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:127) at org.apache.spark.sql.execution.QueryExecution.toRdd$lzycompute(QueryExecution.scala:80) at org.apache.spark.sql.execution.QueryExecution.toRdd(QueryExecution.scala:80) at org.apache.spark.sql.DataFrameWriter$$anonfun$runCommand$1.apply(DataFrameWriter.scala:654) at org.apache.spark.sql.DataFrameWriter$$anonfun$runCommand$1.apply(DataFrameWriter.scala:654) at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:77) at org.apache.spark.sql.DataFrameWriter.runCommand(DataFrameWriter.scala:654) at org.apache.spark.sql.DataFrameWriter.saveToV1Source(DataFrameWriter.scala:273) at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:267) at com.sample.Transformation.main(Transformation.java:194) 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.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:879) at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:197) at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:227) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:136) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) 

      I have set correct values of TTC_SERVER and TTC_SERVER_DSN in sys.odbc.ini file at /var/TimesTen and /var/TimesTen/tt1122 locations.

      Can someone explain the reason?

      sys.odbc.ini

      # Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.  ######################################################################## # This following sample definitions should be in the .odbc.ini file # that is used for the TimesTen 11.2.2 Client. # The Server Name is set in the TTC_SERVER attribute. # The Server DSN is set in the TTC_SERVER_DSN attribute. #########################################################################  [ODBC Data Sources] #sampledbCS_1122=TimesTen 11.2.2 Client Driver #cachedb1CS_1122=TimesTen 11.2.2 Client Driver #repdb1CS_1122=TimesTen 11.2.2 Client Driver #repdb2CS_1122=TimesTen 11.2.2 Client Driver  #[sampledbCS_1122] TTC_SERVER=SERVER's HOSTTNAME TTC_SERVER_DSN=SERVER's DSN  #[cachedb1CS_1122] #TTC_SERVER=SERVER's HOSTTNAME #TTC_SERVER_DSN=cachedb1_1122  #[repdb1CS_1122] #TTC_SERVER=SERVER's HOSTTNAME #TTC_SERVER_DSN=repdb1_1122  #[repdb2CS_1122] #TTC_SERVER=SERVER's HOSTTNAME #TTC_SERVER_DSN=repdb2_1122 

      My connection String in spark code :

      String ttConnection = "jdbc:timesten:client:dsn=<DSN_NAME>;UID=<USER_NAME>;PWD=<PASSWORD>";