I'm trying to create table in hive with java. I found
java.sql.SQLException: org.apache.thrift.transport.TTransportException
while executing my code.
Here is my code
public void createTable(String tableName) {
try{
Statement stat = con.createStatement();
String QueryString = "CREATE TABLE '"+tableName+"'(User_Id INTEGER NOT NULL AUTO_INCREMENT, " + "User_Name VARCHAR(25), UserId VARCHAR(20), User_Pwd VARCHAR(15), primary key(User_Id))";
a = stat.executeUpdate(QueryString);
if(a==1){
System.out.println(a);
System.out.println("Table has been created");
}
}catch(Exception e){
System.out.println(e);}
}
Why this exception is thrown and how can i fix it.?