services

services

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();

        }

        }
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
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
Advertisements
web services
services I did many times but no success found
services
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
ModuleNotFoundError: No module named 'services'
ModuleNotFoundError: No module named 'services'  Hi, My Python... 'services' How to remove the ModuleNotFoundError: No module named 'services... to install padas library. You can install services python with following
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
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
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
Web services - WebSevices
Web services  I need one example of web services with database also. This example should run on eclipse ide
Web Services in PHP
Web Services in PHP  I want to know how can i use webservices in my php app
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
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 - 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
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
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
Version of dentaku>dentaku-services dependency
List of Version of dentaku>dentaku-services dependency
Version of ${pom.groupId}>dentaku-services dependency
List of Version of ${pom.groupId}>dentaku-services dependency
Version of plexus>plexus-services dependency
List of Version of plexus>plexus-services dependency
Version of com.azaptree>azaptree-services dependency
List of Version of com.azaptree>azaptree-services dependency
Version of com.flowlogix>flowlogix-services dependency
List of Version of com.flowlogix>flowlogix-services dependency
Version of com.flowlogix>tapestry-services dependency
List of Version of com.flowlogix>tapestry-services dependency
Version of com.pddstudio>iconmanager-services dependency
List of Version of com.pddstudio>iconmanager-services dependency
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
ModuleNotFoundError: No module named 'async-services'
ModuleNotFoundError: No module named 'async-services'  Hi, My... named 'async-services' How to remove the ModuleNotFoundError: No module named 'async-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cymru-services'
ModuleNotFoundError: No module named 'cymru-services'  Hi, My... named 'cymru-services' How to remove the ModuleNotFoundError: No module named 'cymru-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cymru-services'
ModuleNotFoundError: No module named 'cymru-services'  Hi, My... named 'cymru-services' How to remove the ModuleNotFoundError: No module named 'cymru-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'OctoBot-Services'
ModuleNotFoundError: No module named 'OctoBot-Services'  Hi, My... named 'OctoBot-Services' How to remove the ModuleNotFoundError: No module named 'OctoBot-Services' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'OctoBot-Services'
ModuleNotFoundError: No module named 'OctoBot-Services'  Hi, My... named 'OctoBot-Services' How to remove the ModuleNotFoundError: No module named 'OctoBot-Services' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'pyramid-services'
ModuleNotFoundError: No module named 'pyramid-services'  Hi, My... named 'pyramid-services' How to remove the ModuleNotFoundError: No module named 'pyramid-services' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'pytest-services'
ModuleNotFoundError: No module named 'pytest-services'  Hi, My... named 'pytest-services' How to remove the ModuleNotFoundError: No module named 'pytest-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'services-communicator'
ModuleNotFoundError: No module named 'services-communicator'  Hi...: No module named 'services-communicator' How to remove the ModuleNotFoundError: No module named 'services-communicator' error? Thanks   Hi
ModuleNotFoundError: No module named 'setup-services'
ModuleNotFoundError: No module named 'setup-services'  Hi, My... named 'setup-services' How to remove the ModuleNotFoundError: No module named 'setup-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'tastypie-services'
ModuleNotFoundError: No module named 'tastypie-services'  Hi, My... named 'tastypie-services' How to remove the ModuleNotFoundError: No module named 'tastypie-services' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'taxii-services'
ModuleNotFoundError: No module named 'taxii-services'  Hi, My... named 'taxii-services' How to remove the ModuleNotFoundError: No module named 'taxii-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'vcap-services'
ModuleNotFoundError: No module named 'vcap-services'  Hi, My... 'vcap-services' How to remove the ModuleNotFoundError: No module named 'vcap-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'vfc-services'
ModuleNotFoundError: No module named 'vfc-services'  Hi, My Python... 'vfc-services' How to remove the ModuleNotFoundError: No module named 'vfc-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'wcl_services'
ModuleNotFoundError: No module named 'wcl_services'  Hi, My Python... 'wcl_services' How to remove the ModuleNotFoundError: No module named 'wcl_services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'async-services'
ModuleNotFoundError: No module named 'async-services'  Hi, My... named 'async-services' How to remove the ModuleNotFoundError: No module named 'async-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cognitive-services'
ModuleNotFoundError: No module named 'cognitive-services'  Hi, My... named 'cognitive-services' How to remove the ModuleNotFoundError: No module named 'cognitive-services' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'common-services'
ModuleNotFoundError: No module named 'common-services'  Hi, My... named 'common-services' How to remove the ModuleNotFoundError: No module named 'common-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'cymru-services'
ModuleNotFoundError: No module named 'cymru-services'  Hi, My... named 'cymru-services' How to remove the ModuleNotFoundError: No module named 'cymru-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-services'
ModuleNotFoundError: No module named 'django-services'  Hi, My... named 'django-services' How to remove the ModuleNotFoundError: No module named 'django-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'docker-services'
ModuleNotFoundError: No module named 'docker-services'  Hi, My... named 'docker-services' How to remove the ModuleNotFoundError: No module named 'docker-services' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'drupal_services'
ModuleNotFoundError: No module named 'drupal_services'  Hi, My... named 'drupal_services' How to remove the ModuleNotFoundError: No module named 'drupal_services' error? Thanks   Hi, In your python

Ads