使用JDBC连接到从Bluemix阿帕奇星火服务的PostgreSQL数据库 [英] Connecting to a postgresql db using JDBC from the Bluemix Apache Spark service

查看:226
本文介绍了使用JDBC连接到从Bluemix阿帕奇星火服务的PostgreSQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题连接到我的PostgreSQL8.4分贝上Bluemix使用Apache星火服务。

I have a problem connecting to my postgresql 8.4 db using Apache Spark service on Bluemix.

我的code是:

%AddJar https://jdbc.postgresql.org/download/postgresql-8.4-703.jdbc4.jar -f
val sqlContext = new org.apache.spark.sql.SQLContext(sc)

sqlContext.load("jdbc", Map("url" -> "jdbc:postgresql://<ip_address>:5432/postgres?
user=postgres&password=<password>", "dbtable" -> "table_name"))

和我得到的错误:

名称:java.sql.SQLException中的

Name: java.sql.SQLException

消息:PostgreSQL的:找到了JDBC没有合适的驱动程序//:5432 / postgres用户的Postgres =&放大器;密码=

Message: No suitable driver found for jdbc:postgresql://:5432/postgres?user=postgres&password=

我读过周围,看来我需要将JDBC驱动程序添加到星火类路径。我不知道如何在Bluemix阿帕奇星火服务做到这一点。

I've read around and it seems I need to add the JDBC driver to the Spark class path. I've no idea how to do this in the Bluemix Apache Spark service.

推荐答案

目前与添加JDBC驱动程序Bluemix阿帕奇星火的问题。该团队正在努力解决它。你可以在这里按照进度:
<一href=\"https://developer.ibm.com/answers/questions/248803/connecting-to-postgresql-db-using-jdbc-from-bluemi.html\" rel=\"nofollow\">https://developer.ibm.com/answers/questions/248803/connecting-to-postgresql-db-using-jdbc-from-bluemi.html

There is currently an issue with adding JDBC drivers to Bluemix Apache Spark. The team is working to resolve it. You can follow the progress here: https://developer.ibm.com/answers/questions/248803/connecting-to-postgresql-db-using-jdbc-from-bluemi.html

这篇关于使用JDBC连接到从Bluemix阿帕奇星火服务的PostgreSQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆