cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, Can we connect to the Teradata vantage installed in a vm via the community notebook. I am working on a POC to fetch data from Teradata vantate (just a teradata as it uses the jdbc) and process it in community notebook. Downloaded the terajdbc4.jar

explore
New Contributor

from pyspark.sql import SparkSession

spark = SparkSession.builder.getOrCreate()

def load_data(driver, jdbc_url, sql, user, password):

  return spark.read \

    .format('jdbc') \

    .option('driver', driver) \

    .option('url', jdbc_url) \

    .option('dbtable', '({sql}) as src'.format(sql=sql)) \

    .option('user', user) \

    .option('password', password) \

    .load()

  

driver = 'com.teradata.jdbc.TeraDriver'  

sql = "select * from hr.employees"

url = "jdbc:teradata://<IPADDRESS>/Database=dbc,LOGMECH=TD2"

user = "dbc"

password = "dbc"

df_td = load_data(driver,url,sql,user,password)

df_td.show(10)

Am getting the following error:

java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 17.20.00.08] [Error 1277] [SQLState 08S01] Login timeout for Connection to XXXXX Thu Aug 18 08:18:31 UTC 2022 socket orig=XXXXX cid=2ab4c070 sess=0 java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$ConnectThread.run(TDNetworkIOIF.java:1569) 

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group