0 Bewertungen0% fanden dieses Dokument nützlich (0 Abstimmungen)
15 Ansichten3 Seiten
Actionform must be extends from Validateform and no need to write validate method in actionform in validation.xml add DOCTYPE must be exact correct and shoud include formbean(actionform) name and field property and arguements for checking wether the entering data is avaialable in the db r not take one dbconnclass and include dbconnectionmethod. In this method you should write only Class.forName("") and return DriverManag
Actionform must be extends from Validateform and no need to write validate method in actionform in validation.xml add DOCTYPE must be exact correct and shoud include formbean(actionform) name and field property and arguements for checking wether the entering data is avaialable in the db r not take one dbconnclass and include dbconnectionmethod. In this method you should write only Class.forName("") and return DriverManag
Copyright:
Attribution Non-Commercial (BY-NC)
Verfügbare Formate
Als TXT, PDF, TXT herunterladen oder online auf Scribd lesen
Actionform must be extends from Validateform and no need to write validate method in actionform in validation.xml add DOCTYPE must be exact correct and shoud include formbean(actionform) name and field property and arguements for checking wether the entering data is avaialable in the db r not take one dbconnclass and include dbconnectionmethod. In this method you should write only Class.forName("") and return DriverManag
Copyright:
Attribution Non-Commercial (BY-NC)
Verfügbare Formate
Als TXT, PDF, TXT herunterladen oder online auf Scribd lesen
i.e struts 1.2 add jstl taglibraries 1.0 set build path java compiler to 1.6 or whatever default compiler and then set tomcatserver location and java doc location in application servers and add ojdbc14.jar in C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib be care at declaring packages and importing packages validations and add plugin tag in strutsconfig.xml for validations and ActionForm must be extends from Validateform and no need to write validate method in actionform in validation.xml add DOCTYPE must me exact correct and shoud include formbean(actionform) name and field property and arguements and variable name and variable value
for checking wether the entering data is avaialable in the db r not
take one dbconnclass and include dbconnectionmethod and include dbconnection log ic in it. in this method you should write only Class.forName("") and return DriverManag er.getConnection(""); is enough then after take oneDAO class in DAO you should take eighter boolean type method or list type method whatever it as per requirement but dont forget to include actionform af as a parameter in this method. in DAO you should do formbean obj with type casting into actionform(dont forget to include actionform as a parameter in DAO method declaration) and dont forget to mention form bean parameters declaration(take null values) after that call fom parameters with the help of this formbean obje and call dbconnectionmethod from "dbconnclass" by using likeex (dbconnectioncl assname.dbconnectionclassmethod) into this dao and include all database logic which are update query create query and results, statements, whatever you want and store them in resultset and return true or false as per logic example ResultSet rs=stmt.executeQuery("select username,password from userprofil es where username='"+laf.getUsername()+"' and password='"+laf.getPassword()+"'") ; if(rs.next()){ return true; } return false; then after you should create DAO object in actionclass and with the help of this DAOobject you should call DAOclassmethod(which are cre ate query and whatever you include in DAO everything will call here with the hel p of DAO object and DAO method) for retrieving records from db when u click a link r menu same as like above but the below r extra u need first for link purpose u should need html link tag then after u should add forwardaction tag in strutsconfig.xml for link one jsp t o another jsp(resultsjsp) and the normal action mappings for actionclass and formbean and success r failur e r common in actionform dont forget to add list getter and setters because we are using li st to store results actionclass r common to take then take a BO class(DTO) and add plain setters and getters of form then comet to DAO use this BO object in DAO class with this object name u should set propertyvalues. in while r if and then store this object into arraylist (or add this object to arraylist) DAO class method return type should be list dont forget to set list to formbean like this scaf.setList(list); and final return this arraylist then after call this arraylist into actonclass in action class u should create one more arraylist to store (DAO's return list) and then u should create DAO's object for calling DAO's method and should set request.setAttribute(list) parameter (list (Actioncalss's return list) ) for arraylists importing packages should be carefull. and then u need one jsp for results dispalying purpose in this jsp u need one logic iterator tag and bean tag and u should provide all properties which r in db(coloumns) and u need these 2 tags <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
FOR DATA BASE CONNECTION
for entire project u need to maintain one connection class in that connection class u need to maintain connection static method for using throught the project here careful about to take static method and return type is connection and finally dont for get to return connection
How to configure MyEclipse to develop Hibernate project
1) Open MyEclipse 2) Initially MyEclipse is opened in Java perspective (Java UI). Right click on O pen perspective icon located @ right top corner of the editor and select "MyEcli pse Database Explorer perspective" 3) select "New" icon in the DB browser pane. 4) Fill the profile Profile Name: Oracle IV Driver: click on "Configure database driver" hyper link" click on New button Driver template: Oracle (Thin Driver) click on Add Jars and select D:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar Connection URL: jdbc:oracle:thin:@localhost:1521:XE click on OK, OK Username: active Password: activenet select "Save Password" checkbox and click on Finish