example.TestMain Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of j2mvc-framework-app Show documentation
Show all versions of j2mvc-framework-app Show documentation
强烈建议使用J2mvc 2.1以后的版本。
version 2.1.01
1.更换JSON依赖包.
version 2.1.02
1.移除com.j2mvc.StringUtils.getUtf8()方法调用.
更改为getCharset()
version 2.1.03
1.更新JNDI连接设置
version 2.1.04
1.修改works.xml配置url-pkg-prefixes改为pkg
package example;
import java.util.List;
import com.j2mvc.framework.Session;
import com.j2mvc.framework.config.Config;
public class TestMain {
public static void main(String...args){
// 初始化配置文件
Config.init();
System.out.println("是否输出sql语句:"+Session.sqlLog);
TestUserService service = new TestUserService();
// TestUser user = new TestUser();
// user.setId("100212");
// user.setUsername("test1");
// user.setPassword("test123");
// user = service.save(user);
//
// if(user!=null){
// System.out.println("user数据已保存");
// }
//
List users = service.query("select * from sys_users", null);
for(int i=0;i carts = cs.query("select * from carts", null);
// for(TestCart ca:carts){
// System.out.println("cart:name="+ca.getName()+";price="+ca.getPrice());
// }
}
}