是否支持mycat
samson886 opened this issue · 1 comments
samson886 commented
是否支持mycat
TommyLemon commented
Mycat
项目主页说明:
https://github.com/MyCATApache/Mycat-Server
Mycat连接测试:
测试mycat与测试mysql完全一致,mysql怎么连接,mycat就怎么连接。
测试用例
https://github.com/MyCATApache/Mycat-Server/blob/1.6/src/test/java/demo/test/TestClass1.java
public static void main( String args[] ) throws SQLException , ClassNotFoundException {
String jdbcdriver="com.mysql.jdbc.Driver";
String jdbcurl="jdbc:mysql://127.0.0.1:8066/TESTDB?useUnicode=true&characterEncoding=utf-8";
String username="test";
String password="test";
System.out.println("开始连接mysql:"+jdbcurl);
Class.forName(jdbcdriver);
Connection c = DriverManager.getConnection(jdbcurl,username,password);
Statement st = c.createStatement();
print( "test jdbc " , st.executeQuery("select count(*) from travelrecord "));
System.out.println("OK......");
}
所以 Mycat 是兼容 JDBC 的。
而 APIJSON 也兼容 JDBC,所以两者是能一起用的。
其实 APIJSONORM 是一个 JSON -> SQL 的 ORM 库,
JSON 从哪里来,SQL 到哪里去 都是完全可以自定义的。
任何能连数据库且能执行 SQL 的 工具/库/框架 等,APIJSONORM 都兼容