xxx系统用到了一个非主流的数据库Pervasive
在win下鼓捣了一上午才搞定连接,真个性啊。。。
貌似这个数据库有两种java连接方式,其中一种是JCL方式。貌似是通过比较底层的方式访问数据库,如果性能优先可以考虑这种方式。
JCL is Pervasive PSQL's low level, high speed, transactional data access method for the Java environment. Designed for applications where speed is the driving factor, JCL is the fastest way to access your data via Java. This technology mirrors the Btrieve API.
另外一种是JDBC,很熟悉,不用说了
Sample JDBC Connection Code
Class.forName("com.pervasive.jdbc.v2.Driver");
Connection con = DriverManager.getConnection("jdbc:pervasive://localhost:1583/DEMODATA");
PreparedStatement stmt = con.prepareStatement("SELECT * FROM Course ORDER BY Name");
ResultSet rs = stmt.executeQuery();
Sample JCL Connection String
Session session = Driver.establishSession();
Database db = session.connectToDatabase();
db.setDictionaryLoc("c://PVSW//DEMODATA");
今天才主键体验到原来非主流不仅仅体现在连接上,连有些嵌套的sql语句都不能用。哎!