1.Select a template:选择WLS Domain,Name默认的mydomain 2.Choose Server Type: 第一个 3.Specify Directory for "mydomain" domain:C:eauser_projects 4.value Administrative Server Info-Admin Server Name or ip 写机器的ip,这样保险,其它默认 5.Configure Managed Server: Server Name:默认为myserver Server Listen Address:写机器的ip .其它默认 6.Create System UserName and PassWord:写用户名和密码,如:system:aaaaaa 7.Install Server as Windows Servic:这里问要不要在启动操作系统时启动,可根据自己的需用选择。 8.Install Domain in Windows Start Menu:这里问要不要在开始菜单添加快捷方式,建议是“Yes”. 这样在开始菜单中会出现EBA Weblogic Platform 7.0->User projects-my domain->Start Server
在左边的目录树中选中Services->JDBC->Connection Pools,单击右侧的Configure a new JDBC Connection Pool. 输入以下信息: Configuration->General页: Name = Mysql Connection Pool URL = jdbc:mysql://localhost:3306/ejbdb(注重ejbdb是我上面的例子字段,以下都会这样) Driver classname = org.gjt.mm.mysql.Driver Properties : user=root password=111111 这两行是Properties 的内容,就是name=value形式 单击Create建立连接池。 选择Targets->Server页: 将myserver(服务器名称)移至右侧的列表中,但击单击Apply
在左边的目录树中选中Services->JDBC->Data Sources(或者TXData Sources)单击右侧的Configure a new JDBC Connection Pool.,输入以下信息: Configuration->General页: Name = Mysql Tx Data Source JNDI Name = ejbPool 这个名字就是你以后要引用的DataSource名称 Pool Name = Mysql Connection Pool 选中Emulate Two-Phase Commit for non-XA Driver和Row Prefetch Enabled 单击Create建立数据源。 Targets->Server页: 将myserver(服务器名称)移至右侧的列表中,但击单击Apply,配置完毕
Bean class: com.fuck.axamn.ProductBean Home interface class: com.fuck.axamn.ProductRemoteHome local Home interface class: com.fuck.axamn.ProductHome Remote interface calss: com.fuck.axamn.ProductRemote Local interface calss: com.fuck.axamn.Product
而本例中我是这样命名的: Bean class: com.fuck.axamn.ProductBean Home interface class: com.fuck.axamn.ProductHome local Home interface class: com.fuck.axamn.ProductLocalHome Remote interface calss: com.fuck.axamn.Product Local interface calss: com.fuck.axamn.ProductLocal
findByName方法:SELECT OBJECT(p) FROM ProductBean AS p WHERE p.name=?1 findByDescription方法:SELECT OBJECT(p) FROM ProductBean AS p WHERE p.description=?1 findByBasePrice方法:SELECT OBJECT(p) FROM ProductBean AS p WHERE p.basePrice=?1 findEXPensiveProducts:SELECT OBJECT(p) FROM ProductBean AS p WHERE p.basePrice<?1 findCheapProducts:SELECT OBJECT(p) FROM ProductBean AS p WHERE p.basePrice>?1 findAllProducts:SELECT OBJECT(p) FROM ProductBean AS p WHERE p.productID IS NOT NULL