Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


daksesh
services
0 Answer(s)      2 years and 6 months ago
Posted in : Java Beginners


public class ProductServices {
    public boolean addProduct(ProductBean bean,Connection con)throws SQLException
    {
        PreparedStatement st=null;

        try
        {

            String productName=bean.getProductName();
            String desc=bean.getDescription();
            String features=bean.getFeatures();
            String price=bean.getPrice();
            String quantity=bean.getQuantity();
            String eligibility=bean.getEligibility();
            String thresholdLimit=bean.getThresholdLimit();
            String colorCode="green";

            st=con.prepareStatement("insert into product values(seq_person.nextval,'"+productName+"','"+price+"','"+quantity+"','"+thresholdLimit+"','"+features+"','"+desc+"','"+eligibility+"','"+colorCode+"')");
            int rs=st.executeUpdate();

        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
        finally
        {
            con.close();
            st.close();



        }
        return false;
    }
    public void updateProduct(ProductBean bean, Connection conn)
    throws SQLException {
        PreparedStatement statement=null;

        try {

            String productname = bean.getProductName();
            String price = bean.getPrice();
            String quantity = bean.getQuantity();
            String thresholdLimit=bean.getThresholdLimit();
            String eligibility=bean.getEligibility();



            statement = conn.prepareStatement("Update Product set PRICE='"+price+"',QUANTITY='"+quantity+"',THRESHOLD_LIMIT='"+thresholdLimit+"',ELIGIBILITY_FOR_REWARDS='"+eligibility+"' where PROD_MODEL_NAME='"+productname+"' ");

            int rs=statement.executeUpdate();

        } catch (SQLException sqle) {

            conn.close();
        } catch (Exception e) {

            conn.close();
        }
        finally
        {
        conn.close();
        statement.close();

        }

        }
public void deleteProduct(ProductBean bean, Connection conn)
    throws SQLException {
        PreparedStatement statement=null;

        try {

            String productName = bean.getProductName();
            String price = bean.getPrice();
            String quantity = bean.getQuantity();
            String thresholdLimit=bean.getThresholdLimit();
            String eligibility=bean.getEligibility();



            statement = conn.prepareStatement("Delete Product where PROD_MODEL_NAME='"+productName+"' ");

            int rs=statement.executeUpdate();

            statement = conn.prepareStatement("Delete ret_prod where PRODUCT_ID in(select PRODUCT_ID from Product where PROD_MODEL_NAME='"+productName+"' )");
            int rs1=statement.executeUpdate();

            statement = conn.prepareStatement("Delete stock where PRODUCT_ID in(select PRODUCT_ID from Product where PROD_MODEL_NAME='"+productName+"' ) ");
            int rs2=statement.executeUpdate();

        } catch (SQLException sqle) {


        } catch (Exception e) {


        }
        finally
        {
        conn.close();
        statement.close();

        }

        }

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Web Services
Web Services  Explain web services with example?? asked by 4p3   Please visit the following link: Webservices Tutorials
Advertisements
Joomla Services
Joomla Services Here in RoseIndia Technologies, we offer a broader range of service like creating highly innovative and interactive websites, developing..., Printable Versions, Blogs etc. Moreover we also offer following services
web services
services I did many times but no success found
Web Services
Web Services       Normally... services goes on in our daily-life. Web services was first time introduced in EJB2.1, while EJB3.0 made the web services development easy and more flexible
Web Services - XML
What is Web Services and why it is used for?  What is Web Services and why it is used for? Can anyone suggest a best tutorial website for web services
Web Services Tutorials
Web Services Tutorials  I am learning Web Services. Give me the examples of Web Services. Thanks   Hi, Check the tutorial Web Services Examples in NetBeans. Thanks
Web Services - Web Services Tutorials
Web Services - Web Services Tutorials In this section of the Web Services tutorial you will be familiarized with the Web Services. Introduction... to the remote source. One can access Web services using nothing but HTTP. Of all
Java Message Services - JMS
Java Message Services  What is Java Message Services
services provided by a container
services provided by a container  What are the services provided by a container?   The services provided by container are as follows: Transaction management for the bean Security for the bean Persistence of the bean
Types of hosting services
looking for the hosting services. But I don't know how many types of hosting services exists these days. Can anyone tell me about different Types of hosting services and what are the merits and demerits of each of them? Looking for good
Web Services in PHP
Web Services in PHP  I want to know how can i use webservices in my php app
Web services - WebSevices
Web services  I need one example of web services with database also. This example should run on eclipse ide
Web Services Growth
Web Services Growth The growth of open standards creates new opportunities for designers and developers of applications and services. By writing to Java... of their perspective customers. By making its legacy data available via XML-based Web services
web services - WebSevices
web services  Give me description about web services?how wewill use soap,wsdl,uddi.Give me explanation with examples
Web Services Issue - WebSevices
Web Services Issue  My requirement is to invoke web services through... will invoke the services in my application which is running in web sphere. in my case through delegate class i have to invoke the services. So plz help me because i
Sitemap Web Services Tutorial
Map | Business Software Services India Web Services Tutorial Section... Axis2 on Tomcat | Web services technologies | Installing axis2 eclipse... | Java Client webservice | Cheap Web Hosting Services in Mumbai | Cheap Web
spring Web Services - Spring
spring Web Services  Hi, Can any one explains or give me some example which gives me that how to start up spring web services. Thanks, mahi
XMl and Java web services
XMl and Java web services  I want to do a project on java web services and XML. I wanted to ask, how the data entered by user through the HTML file... the data can be retrieved back from that XML file so that using web services
Java message services
; Java Message Services In this section, you will read about the java messages Services (JMS). This tutorial provides an overview of the JMS and offers the basics for developing programs using it. The java message services API
WEB-SERVICES-JAXRPC - WebSevices
WEB-SERVICES-JAXRPC  when i excute simple webservice i got this exception:javax.xml.rpc.JAXRPCException plz hel me how to resolve?  Hi Friend, Please visit the following links: http://www.roseindia.net/webservices
Software Outsourcing Services India
outsourcing services? Get the best package from Rose India Software... and outsourcing services. Our Software Services
creating web services - WebSevices
creating web services  Actually i am new for web services so Plz tell me how we can create and implement a web services, and please send any easy...;** Simple Example of Developing Web services in Java ** By Vijeta Jaiswal M.Tech
Web Services - Web Services Tutorials
Web Services       Normally... services goes on in our daily-life. Web services was first time introduced in EJB2.1, while EJB3.0 made the web services development easy and more flexible
Good web services site - WebSevices
Good web services site  Hi can i get reference to the web services site, where i can get the complete web services for scratch.  Hi Naresh, I guess u r in right place. I learn my self from roseindia. thanks
web services security testing by soapUI
web services security testing by soapUI  how to make security testing to online examination system by soapUI
Java Message Services
Java Message Services       In this section, you will read about the java messages Services (JMS... for developing programs using it. The java message services API is a java Message oriented
EJB container services
EJB container services       The EJB container is a container that deploys EJB automatically when Web Server... the EJB container services:-   Services  
Web Services
Web Services         Web services are web-based application that translates your application into browser-based application using XML, SOAP, WSDL
Different types of web hosting services
companies giving hosting services. They giving lot's of hosting plan as hosting packages... types of web hosting services. Can anyone explain me different types of web hosting services available these days? Thanks
Why to use Web Services
Why to use Web Services         Why to use Web Services Web services have the tendency of higher Interoperability
 

 

 

DMCA.com