Your first DDL should be correct (as long as the JDBC URL is correct). The string after USING should be the data source name ("org.apache.spark.sql.jdbc" or simply "jdbc").

The SQLException here indicates that Spark SQL couldn't find SQL Server JDBC driver in the classpath.

As what Denny said, currently the JDBC data source is not extensible and only provides good support for MySQL and PostgreSQL, but I'd expect that simple standard SQL queries should work.

Cheng

On 4/7/15 1:40 PM, bipin wrote:
Hi, I am trying to pull data from ms-sql server. I have tried using the
spark.sql.jdbc

CREATE TEMPORARY TABLE c
USING org.apache.spark.sql.jdbc
OPTIONS (
url "jdbc:sqlserver://10.1.0.12:1433\;databaseName=dbname\;",
dbtable "Customer"
);

But it shows java.sql.SQLException: No suitable driver found for
jdbc:sqlserver

I have jdbc drivers for mssql but i am not sure how to use them I provide
the jars to the sql shell and then tried the following:

CREATE TEMPORARY TABLE c
USING com.microsoft.sqlserver.jdbc.SQLServerDriver
OPTIONS (
url "jdbc:sqlserver://10.1.0.12:1433\;databaseName=dbname\;",
dbtable "Customer"
);

But this gives ERROR CliDriver: scala.MatchError: SQLServerDriver:4 (of
class com.microsoft.sqlserver.jdbc.SQLServerDriver)

Can anyone tell what is the proper way to connect to ms-sql server.
Thanks






--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Microsoft-SQL-jdbc-support-from-spark-sql-tp22399.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to