jpa w/ spring

https://www.ibm.com/developerworks/cn/opensource/os-cn-spring-jpa/index.html

javassist 3.12 GA doesn't work with JAVA8, with have invalid constant type 18 error, need to use javassist 3.18 GA or above.

String driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver";
String dbURL = "jdbc:sqlserver://munsqldev1:2647;databaseName=CCC";
try {
Class.forName(driverName);
Connection dbConn = DriverManager.getConnection(dbURL, "municcc", "apple1");
System.out.println("connected");
int i = 121046128;
mscpService = new MscpService();
System.out.println(mscpService.getByLoanNumber(new Long(i)));
} catch (SQLException | ClassNotFoundException e) {
System.out.println("not connected");
// TODO Auto-generated catch block
e.printStackTrace();
}

原文地址:https://www.cnblogs.com/goldengallo/p/7538914.html