我正在尝试使用Apache Zeppelin连接到mysql db。
public class TestClass {
private String getXmlBody(Object o, Matcher matcher) throws Exception {
Format format = new Format(4, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
Serializer serializer = new Persister(new AnnotationStrategy(), matcher, format);
Writer writer = new StringWriter();
serializer.write(o, writer);
writer.write('\n');
return writer.toString();
}
public static void main(String[] args) throws Exception {
Data data = new UIDData("some UUID value ");
SpecificRequest specificRequest = new SpecificRequest(data);
Request request = new Request(specificRequest);
System.out.println(getXmlBody(request, new RegistryMatcher()));
}
}
@Root(name = "Request")
class Request {
@Element(name = "SpecificRequest")
private SpecificRequest mSpecificRequest;
public Request(SpecificRequest specificRequest) {
mSpecificRequest = specificRequest;
}
}
class SpecificRequest {
@Element(type = UIDData.class)
private Data mData;
public SpecificRequest(Data data) {
mData = data;
}
}
abstract class Data {
private String mType = "";
protected Data(String type) {
mType = type;
}
// other abstract stuff
}
class UIDData extends Data {
@Element(name = "UniqueID")
private String mUID;
public UIDData(String UID) {
super("UID");
mUID = UID;
}
}
这给我和错误
%mysql
val spark = org.apache.spark.sql.SparkSession.builder.master("spark://192.168.***.***:7077").appName("Spark CSV Reader").getOrCreate;
val SKdata = spark.read.format("jdbc").option("driver", "com.mysql.jdbc.Driver").option("url", "jdbc:mysql://192.168.***.***/good; user= boot; password= bootpass")
.option("dbtable", "person").load()
我该如何调试?