Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

是否支持mycat #64

Closed
samson886 opened this issue Dec 27, 2018 · 1 comment
Closed

是否支持mycat #64

samson886 opened this issue Dec 27, 2018 · 1 comment

Comments

@samson886
Copy link

是否支持mycat

@TommyLemon
Copy link
Collaborator

TommyLemon commented Dec 27, 2018

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 都兼容

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants