我正在尝试将ElasticSearch与MySQL结合使用. JDBC River似乎正是我想要的,但我不能将我的数据插入除了jdbc/jdbc使用之外的任何地方:
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://localhost:3306/the_db",
"user" : "root",
"password" : "hunter2",
"sql" : "select * from hamburgers",
"index" : "the_db",
"type" : "hamburgers"
}
}'
Run Code Online (Sandbox Code Playgroud)
我希望可以访问数据localhost:9200/the_db/hamburgers(从我可以从文档中清除的内容),但它完全可以访问localhost:9200/jdbc/jdbc
为什么我在Employee构造函数的启动中遇到错误,找不到符号构造函数Person?
class Person {
String name = "noname";
Person(String nm) {
name = nm;
}
}
class Employee extends Person {
String empID = "0000";
Employee(String eid) {// error
empID = eid;
}
}
public class EmployeeTest {
public static void main(String args[]) {
Employee e1 = new Employee("4321");
System.out.println(e1.empID);
}
}
Run Code Online (Sandbox Code Playgroud)