Can anybody give me the jdbc code for postgres database.

Hello all,
I tried to search for sample jdbc code for postgres. But I couldn't find working sample. Can anybody please post the sample jdbc code for connecting to postgres database.
I have already added the jar file, "postgresql-8.0-312.jdbc3.jar" to the build path.
Thanks.
Srinivas

Hi,
Thanks for your reply!
I wrote the following code, but the insert doesn't add a row.
try {
          Class.forName("org.postgresql.Driver");
          //Preparing Conenction String     
          Connection con = DriverManager.getConnection("jdbc:postgresql://<name>:5432/sales_office_test", "sales_office_data","sales_office_data");
          PreparedStatement prepSt =  con.prepareStatement(
                              "INSERT INTO office_personnel (office_id, salutation, firstname, lastname, email_address,"
                              + " cellphone, phonenumber, extension, password, username) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
                         prepSt.setString(1, newOfficeIds);
                         prepSt.setString(2, whopperUserSalutation);
                         //Close statement
                         prepSt.close();
     } catch (ClassNotFoundException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
     } catch (SQLException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
     }If I print the connection object I get
Sql connection value: org.postgresql.jdbc3.Jdbc3Connection@10965c3 I double checked the same query by directly executing it on the web interface to the postgres, works fine there and creates the row...
What could be wrong.
Thanks
Srinivas

Similar Messages

  • Can you give me the example codes for DaqCard-12​00 at register-l​evel programmin​g

    Where could I find some example code in DaqCard-1200 Register_level programming Manual

    This forum is for discussion of Measurement Studio for Visual C++. You can post questions about DAQ to the Multifunction I/O secition here.
    Best Regards,
    Chris Matthews
    National Instruments

  • Why won't Apple give out the unlock code for an iPhone 3Gs when the contract was honored and I am still an AT

    Why won't Apple give out the unlock code for an iPhone 3Gs when the 2  year contract was honored and I continued to be an AT&T customer with an iPhone 4. I wanted my old 3gs unlocked so my daughter could use it overseas when she is deployed. AT&T service over there *****, the international plan was not worth it. The individual SIM cards per country are much more reliable and cheaper. Teslestial in Iraq and Afghanistan, Telecom in Croatia,Vodafphone in Germany and Italy.  Why Apple will not unlock these phones for our military to utilize is incomprehensible to me.  These young men and women are fighting for these Apple people to go to work every day, safe, to live lives they have become accustom to yet releasing a phone to use on another network they can't do at least for the military.... WHY APPLE??  WHY?   A good excuse not some of the many lame excuses I have received on the phone many times. AT&T states it is Apple that will not allow them to unlock the phones...  Please tell me why?  All I want Is my daughter to have a phone I trust, to be able to call me when she is given the free time to do so and I trust the apple phone.
    Apple, please reconsider your stance on this issue.  I am having a hard time understanding why you will not unlock the iPhone. 
    A simple code could allow me to talk to my daughter while fighting for our country the Great USA.  Apple should be on the front line and enabling those fighting for our life, liberty and pursuit of happiness to use unlocked phones on reliable local GSM networks.
    I honestly hope that someone who has some sort of authority to begin allowing the release of unlock codes, and not forcing people to unlock their phones with some program produced by some hack just to be able to use your wonderful phone.  That is is in a nutshell, People love the iPhone so much that they want the ability to use it on the most reliable GSM carrier available to them.  That should be a major compliment. Even men and women on the front line want your phone. I agree, my service is not the best where I live either, love the GSM technology so stay with it, but if I had the ability to change to the other GSM network that has much better coverage in this area of the country I would change. To change now I would not have my iPhone and that I will not part with. 
    Apple, please reconsider opening up the lock code and allow your gem of a phone to be used by many more people in many more areas and most importantly overseas fighting for our country.  I know if this is really thought about Apple would understand and come to the conclusion to release the unlock codes, and stop the people from hacking in to use the iPhone on other networks.
    I would love for my daughter to be able to use my iPhone 3gs while fighting for our Free country.
    A response would be appreciated.
    Thank you.
    An Apple customer for 10 years, phones and computers.
    P

    Defiled:
    I did sign a two year contract and completed that contract. The 3gs is no longer in service. My daughter is going overseas to protect you and your family. I was attempting to find a way for her to have a reliable phone that could offer her some connection with home as she travels through the middle east.  She travels in missions all over.
    At&T unlocks other phones of theirs why not the iPhone?  AT&T says that Apple will not give them the code, it is not the carrier.  If I would have known this situation would have come up I would have bought and unlocked 3gs phone"Deggie" .  My main complaint is that Apple has not good excuse as to why they will not allow their phones to be unlocked from services well, AT&T .  I bought the phone full price, completed the contract terms, even went for and iPhone 4 with another2 year contract, along with owning an apple computer... I love the product.  My main issue is give me a good answer as to why you won't allow a phone to be unlocked. It doesn't hurt Apple, People still have to buy the phones from them, and use their App store and iTunes.
    Sorry, just upset about my daughter heading over there, boots on the ground, and just pray she will be safe. Would have liked to facetime her while she is in the airports and in specific areas allowed for that.
    Please don't come down on me for asking this question. I understand all the contracts etc.... but to single out the iPhone specifically to not unlock after contract is over does not seem fair.
    Thank you for your responses.

  • Can you give me the source code of FilenameFilter

    can you give me the source code of FilenameFilter?

    what do you want it for
    i could give you a simpler logic to the FilenameFilter
    public boolean filenamefilter(File f,String Stringffilename){
    boolean b;
    if((f.toString()).endsWithIgnorecase(Stringffilename)){
    (b=true);}
    return
    }you could check <b>FilenameFilter.java</b>
    after extracting your src.jar||src.zip

  • Can anybody give me the table with tcode and its development class

    can anybody give me the table with tcode and its development class

    Hi phani,
    1) First retrieve program name from tstc table I.e field pgmna.
      2) Using pgmna retrieve from tadir table by using the following criteria from tadir table
       pgmid    = 'R3TR'
      AND object   = 'PROG'
      AND obj_name = tstc-pgmna.
    We will get development class or package in tadir i.e
    tadir-devclass 
    Thanks,
    Naveen Kumar.

  • Can anybody give me complete guideance & code about using j2me web service?

    Hi to all !
    I have posted problem about using j2me web service ...
    but still nobody have give me at least one response..
    can anybody give me complete example about using webservice in j2me?
    premal

    Hi to all !
    I have posted problem about using j2me web service
    but still nobody have give me at least one
    response..
    can anybody give me complete example about using
    webservice in j2me?
    premal-----------------------------------
    Hi, You may find help using netBean IDE.In netBean IDE help, there you should find step by step solusion for web service as well soap messang technology
    your best regard
    http://www.techbd.com
    [email protected]

  • Can anyone give me the process flow for MTBF report?

    hi all
        can anyone give me the process flow of MTBF Report?
    regards
    asha

    And Full form of MTBF is ???
    Regards
    Amitava

  • Can anybody give me the formula for Database capacity planning for 10gR2?

    Hi ,
    I want to learn how to make database capacity planning for production in 10gR2. Here i need any formula to plan the capacity.
    Can anybody help me?
    Regards
    Rajesh

    hi,
    There is no perfect world. There is no perfect application. If I am permitted to say, there is no perfect CAPACITY PLANNING. In this world, we strive hard to achieve near PERFECTION
    DISK SPACE ESTIMATED FOR THE DATABASE(RDBMS) ONLY
    ESTIMATES ARE BASED ON ASSUMPTIONS, SAMPLING, STATISTICS
    ESTIMATES CAN NOT QUANTIFY DISK SPACE REQUIREMENTS IN REAL TIME
    ACTUALS ALWAYS VARY FROM ESTIMATES.
    so ther is no particular formula to plan capacity planning.
    or post your rquirements for the DB and wait for some reply
    regards,
    Deepak

  • Can anybody give me the solutions for these

    In the definition of Item Catogory vov7, thers is a field " Relevent for Delivery", The same field is there in the definition of Scheduleline catagory vov6.
    1. Y the same field is there in both definitions?
    2. If I didnt check the field in item catagory definition, then item cannot be deliver?
    3.Y should we check in itemcatagory and scheduline catagory definition the field " relevent for delivery"
        If i check in Item catagory , if i didnt check in scheduline catagory any problem occurs at the time of delivery
    Plz reply me for these questions
    Thanks in Advance
    Venkat Ramana

    Dear Venkata Ramana
    - In VOV7, if you select the field "Relevant for Delivery", then you are defining that the item category is relevant for creating delivery and posting goods issue.
    - Similarly, in VOV6, by selecting the field Relevant for Delivery, you are defining that the schedule line is relevant for delivery
    As you would be aware, you can create invoice referencing order and delivery as well.  So in order to differentiate the item category and schedule line category from this, you have to maintain different item categories and schedule line categories.
    thanks
    G. Lakshmipathi

  • Can anybody give me some reference material for BADI?

    Best regards,

    Hi,
      Goto transaction SE18. Enter the BADI name.
    Click on Implementation option in Tool Bar. Create a new Implementation.
    Click on the method available on it.
    You can write your code in this method.
    Implementing Business Add-Ins (BADI)
    The use of object orientated code within SAP has lead to new method of enhancing standard SAP code called
    Business Add-Ins or BADI's for short. Although the implementation concept is based on classes, methods and
    inheritance you do not really have to understand this fully to implement a BADI. Simply think of methods
    as a function module with the same import and export parameters and follow the simple instructions below.
    Steps:
    1. Execute Business Add-In(BADI) transaction SE18
    2. Enter BADI name i.e. HRPBSGB_HESA_NISR and press the display
    button
    3. Select menu option Implementation->Create
    4. Give implementation a name such as Z_HRPBSGB_HESA_NISR
    5. You can now make any changes you require to the BADI within this
    implementation, for example choose the Interface tab
    6. Double click on the method you want to change, you can now enter
    any code you require.
    7. Please note to find out what import and export parameters a
    method has got return the original BADI definition
    (i.e. HRPBSGB_HESA_NISR) and double click on the method name
    for example within HRPBSGB_HESA_NISR contract is a method
    8. When changes have been made activate the implementation
    See below link for more info:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702
    Goto transaction SE18. Enter the BADI name.
    Click on Implementation option in Tool Bar. Create a new Implementation.
    Click on the method available on it.
    You can write your code in this method.
    See below link for more info:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0456c54-0901-0010-f0b3-cd765fb99702
    Step by step proc
    http://www.sapdevelopment.co.uk/enhance/enhance_badi.htm
    Also the foll links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/03853c01c89d7ce10000000a11405a/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/5f/071eed117c11d5b37d0050dadef62b/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/eb/3e7cf4940e11d295df0000e82de14a/frameset.htm
    http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
    http://www.sapdevelopment.co.uk/tcodes/tcodes.htm
    infospoke with transformation with badi
    http://help.sap.com/saphelp_nw04/helpdata/en/c5/03853c01c89d7ce10000000a11405a/content.htm
    Regards
    Kiran Sure

  • Can anybody give me the difference between Catt and Ecatt

    Hi gurus,
    Can any body give me the difference between catt and ecatt.

    Hi,
    I think this is new technology in sap.
    I know little bit of this can u go through this.
    eCATT (extended Computer Aided Test Tool)
    What is eCATT?
    eCATT is an SAP Testing Tool used to automate & test business scenarios in R/3. Each test generates a detailed log that documents the test process and results. If the testing is smooth without any errors, this means that the business scenarios mapped in R/3 are correct. If the test results in error then the problem can be analyzed using the error log that is generated. 
    eCATT enables automatic testing in SAP GUI for Windows and SAP GUI for Java.
    Features of eCATT:
    Following functions can be performed using eCATT:
    Test transactions, reports and scenarios.
    Call BAPIs and function modules.
    Test remote systems.
    Check authorizations (user profiles).
    Test updates (database, applications, GUI).
    Set up customizing tables.
    Test the effect of changes to customizing settings.
    Perform load testing.
    Check system messages.
    Integrated with Test Workbench, so allows proper management of scripts using SCAT transaction.
    Supports CATT migration to eCATT.
    All eCATT Objects are Repository Objects. Therefore one can take advantage of Standard SAP Transport Tools.
    eCATT Objects can easily download & upload in XML with XSD format.
    There can be several versions of Test Scripts, which allows different implementations with different releases.
    The separation of Test Scripts, Test Data & System Data allows for a considerable degree of reuse.
    Why eCATT?
    CATT is no longer supported by SAP for the creation of new developments. Hence all the test scripts developed in CATT are now need to migrate/Update to eCATT. Comparative to manual testing, the following are advantages of using eCATT:
    Due to automation, testing time is reduced to a large extent.
    Due to automation, less manpower is required for testing. This helps financially.
    Due to automation, manual errors are reduced to large extent. Hence results in error free testing. This helps, as no further problems will occur while the usage of R/3 system by end users and hence increases the efficiency.
    Proved to be extremely useful in implementation projects.
    In regression testing, automated test scripts are an ideal method of quickly detecting errors. Automatic test logs make it easy to reproduce test results, enabling fast analysis and planning of further activities, leading to cost savings for the customer.
    Differences between CATT and eCATT?
    Till date, CATT could only be used with the R/3 system. eCATT (which is available with SAP Web Application Server 6.20) covers the automatic testing in SAPGUI for Windows and SAP GUI for Java. For other GUIs and Applications, eCATT provides an interface for external tools. This allows companies to perform automated tests from an SAP system in a complete IT solution landscape across system boundaries. These new options enable complete automation of solution landscapes under standard Windows and Web-based user interfaces- resulting in low-cost operation of an IT Solution.
    eCATT (extended Computer Aided Test Tool)
    eCATT requisites
    Web Application Server (WAS) 6.20 or more.
    SAPGUI 6.20 or more.
    R/3 4.6C or more. (Target system must have sufficient support package level (Details available in SAP Note 519858) or SAP R/3 Enterprise Release 4.7).
    Before creating Test Scripts using eCATT, some system settings need to be done: 
    Maintain table T000.
    1.      Go to transaction SM31
    2.      Enter T000 and chose MAINTAIN.
    3.      In the Change View “Clients”: Overview screen, select the relevant client and choose “Details”
    4.      In the “CATT and eCATT Restrictions” field, select “CATT and eCATT allowed”.
    5.      Click on SAVE. 
    Enabling scripting at the Front-end
    1.      On any SAP GUI screen, choose “Customizing of Local Layout”.
    2.      Choose Options
    3.      Choose “Scripting Tab”
    4.      Select “Enable Scripting”
    5.      Click Apply and then OK. 
    Enabling Scripting on the Application Server
    1.      Go to transaction RZ11.
    2.      On the Maintain Profile Parameters screen, enter sapgui/user_scripting.
    3.       Choose Display.
    4.      If the Current Value is not set to TRUE, then click on Change Value:
    5.      Enter TRUE in the “New Value”.
    6.      Click on SAVE.
    eCATT is an SAP Testing Tool used to automate & test business scenarios in R/3. Each test generates a detailed log that documents the test process and results. If the testing is smooth without any errors, this means that the business scenarios mapped in R/3 are correct. If the test results in error then the problem can be analyzed using the error log that is generated. 
    eCATT enables automatic testing in SAP GUI for Windows and SAP GUI for Java.
    Features of eCATT:
    Following functions can be performed using eCATT:
    Test transactions, reports and scenarios.
    Call BAPIs and function modules.
    Test remote systems.
    Check authorizations (user profiles).
    Test updates (database, applications, GUI).
    Set up customizing tables.
    Test the effect of changes to customizing settings.
    Perform load testing.
    Check system messages.
    Integrated with Test Workbench, so allows proper management of scripts using SCAT transaction.
    Supports CATT migration to eCATT.
    All eCATT Objects are Repository Objects. Therefore one can take advantage of Standard SAP Transport Tools.
    eCATT Objects can easily download & upload in XML with XSD format.
    There can be several versions of Test Scripts, which allows different implementations with different releases.
    The separation of Test Scripts, Test Data & System Data allows for a considerable degree of reuse.
    Why eCATT?
    CATT is no longer supported by SAP for the creation of new developments. Hence all the test scripts developed in CATT are now need to migrate/Update to eCATT. Comparative to manual testing, the following are advantages of using eCATT:
    Due to automation, testing time is reduced to a large extent.
    Due to automation, less manpower is required for testing. This helps financially.
    Due to automation, manual errors are reduced to large extent. Hence results in error free testing. This helps, as no further problems will occur while the usage of R/3 system by end users and hence increases the efficiency.
    Proved to be extremely useful in implementation projects.
    In regression testing, automated test scripts are an ideal method of quickly detecting errors. Automatic test logs make it easy to reproduce test results, enabling fast analysis and planning of further activities, leading to cost savings for the customer.
    Reward points if it is helpful.
    Rgds,
    P.Nag

  • Can anybody give me the list of variables can pass in the requestPlatform

    hi all,
    I am very curious about knowing the list of variables that can be passed to requestPlatform().
    as i know we can pass tel,url and fax.Is there any variables that can be passed.
    I want to know the Operating System variables...
    My objective was to get the location name..
    thanks in advance

    hi ,
    thanks for your help,
    I want to get the location name (which will display on your mobile when you moving from one region to another region),is there is any way to capture that information...
    one more question is this possible to get the information in the mobile device with the help of the requestPlatform(),like we have initiatng the phone call something like that
    thanks in advance
    lakshman

  • My 5510 printer will not print to give me the printer code for e print!

    my printer will not let me print my code so i can set up e print. It keeps saying unable to connect to server? any ideas why?

    How do I find my printer code on my HP5510

  • Where's the source code for the MIDP 2.0

    Hi
    does anybody know if the source code for the MIDP 2.0 is available anywhere, if so please give me the link, I've searched for it but couldn't find. I need it to create a custom class based on the Command class, but need to have a look at the source code of the "Command" to make the appropriate changes to my extending class, so I can't do it without a look under the hood.
    Any help would be greatly appreciated

    You can find reference implementations at http://java.sun.com/products/midp/index.jsp
    But they are only to assist manufacturers in implementing their own versions, and do not necessarily reflect the code running on a given device. All you can assume is what is stated in the MIDP specification. However, reading the RI code may help you better understand the spec.

  • I am new to Service module,can anybody give the over view of service module

    I am new to Service module,can anybody give the over view of service module including base table and Relation ship with other Oracle Application module.

    Hello Les,
    Think that you want to buy television or computer and how will you proceed for that.
    1. Material Requirement : Your family will ask you that they need television so that is material requirement from the users (family), they will also give additional information like what is the size of TV, which brand etc
    2. Quotation (Inquiry) : now you have requirement that you need one TV so you will looking for different vendors i.e. Phillips, Sharp, AIWA, Deawood and ask them to give the prices and other terms (free shipping, service after sales ) for TV
    3. Quotation comparision : Once you get the price from all your supplier, you will make comparision on price and other terms also you can negotiate the price with vendor asking for discounts, free door delivery
    4. Vendor Selection: Based on your negotiation you will identify the best deal and place order to that vendor.
    5. Purchase order : You will place order to vendor asking for material (TV), for certain price on particular date at particular location (you home).
    6. Goods Receipt : Once vendor delivers TV then you will receive the material at your location
    7. Invoice receipt: Vendor will send the invoice with that delivery and you will check the price and make the payment to vendor,
    I hope this will help you to under stand the concept of Procurment cylce.
    More details you can get it from the link which I provided.
    Regards
    Arif Mansuri

Maybe you are looking for

  • Creating a better update table statement

    Hello, I have the following update table statement that I would like to make more effecient. This thing is taking forever. A little background. The source table/views are not indexed and the larger of the two only has 150k records. Any ideas on makin

  • When in album view it does not update to the next track.

    It's still on an album that I played weeks ago. Can Iget it to update with each new track? Thanks.

  • HELP - CONVERTING A JPEG IMAGE INTO A LINE DRAWING

    PLEEEASE HELP ME!!! sorry to be thick - im only a beginner   ---   is there any way to covert a jpeg image into like a line drawing where there is a block colour background and solid lines that make up the picture like you sometimes get in brochures

  • General  task (inconsistency SOBJ error)

    Hi Experts, I have the following issue. When I am trying to make the tasks in my workflow as 'Genreal Task'(Edit>Attributes>GeneralTask), I am getting the following message. 'Please check the order's object list (inconsistency SOBJ)'. I  are able to

  • HT1766 itune has detected an iphone in recovery mode

    itune has detected an iphone in recovery mode, you must restore this iphone before it can be use with itune. Can someone help how can I resolve this without having to clear all my data in my iphone 4S?