Error:
java.sql.SQLException: No suitable driver found for jdbc:hive://localhost:10000/default at java.sql.DriverManager.getConnection(DriverManager.java:596) at java.sql.DriverManager.getConnection(DriverManager.java:233) at demo.utils.JDBCUtils.getConnection(JDBCUtils.java:25) at demo.hive.HiveJDBCDemo.main(HiveJDBCDemo.java:16) Exception in thread "main" java.lang.NullPointerException at demo.hive.HiveJDBCDemo.main(HiveJDBCDemo.java:18)
Solution:
url->change hive to hive2
before:
private static String driverString = "org.apache.hive.jdbc.HiveDriver"; private static String urlString = "jdbc:hive://localhost:10000/default";
after:
private static String driverString = "org.apache.hive.jdbc.HiveDriver"; private static String urlString = "jdbc:hive2://localhost:10000/default";
Similar Posts:
- Error occurred when Android connected to cloud MySQL: java.lang.NoClassDefFoundError : Failed resolution of: Ljava/sql/SQLType
- mysql connection reports java.math.BigInteger cannot be cast to java.lang.Long exception
- Java.math.BigInteger cannot be cast to java.lang.Long [How to Solve]
- [Solved] JAVA:java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcodbcDrive
- The jdbc driver imported from idea into MySQL appears “Java. Lang. classnotfoundexception: com. Mysql. CJ. JDBC. Driver”
- [Solved] spark Connect hive Error: javax.jdo.JDODataStoreException: Required table missing : “`DBS`” in Catalog “” Schema “”
- Thread.currentThread().getContextClassLoader()Class.getClassLoader()
- java.sql.SQLException: Fail to convert to internal
- com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
- Hive Start Error: Exception in thread “main” java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgumen