Results 1 to 6 of 6

Thread: How to use Python to connect DB2 database

  1. #1
    Join Date
    Feb 2010
    Posts
    641

    How to use Python to connect DB2 database

    Hi all,

    I want to know that how to format XML data is stored in a database, from a Python application to connect to DB2 as well as data from CSV files into XML documents of the developers. I am using Microsoft Windows operating system, but the code should be used for other operating systems. I will be able to create a powerful Python application, it can interact with the IBM DB2 database and take advantage of pureXML provides functionality. Please advice. Thanks in advance.
    Last edited by Radames; 04-03-2010 at 01:42 AM.

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    How to use Python programming language to connect DB2 database

    Let's begin to create the database. Open the DB2 Command Editor by Start> Programs> IBM DB2> [DB2 Instance Name]> Command Line Tools and enter the following command:
    Code:
    create database census using codeset UTF-8 territory US
    To complete the process takes a minute or two, please be patient. Is complete, you will receive a response to this messageB20000I The CREATE DATABASE command completed successfully You can Command Editor by pressing Ctrl + Enter to execute commands quickly.Now use the following command to connect to the newly created census database:connect to census。Here, you should receive a response message from the DB2 server:A JDBC connection to the target has succeeded。Now you've created a database, you can create an application used to store data in a sheet. All the best.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    How to use Python programming language to connect DB2 database

    Python is very concerned about the readability of the code high-level programming languages. And many other programming style, indentation, and the decision by the developers in different programming languages, Python requires you to use indentation to indicate blocks of code (such as classes, statements and loops). Python easy to learn, the generated code is very clean and beautiful, suitable for many different platforms, so it is the development of many applications, a good choice items. Although Python is usually pre-installed on Mac OS X and Linux operating systems, but it does not pre-installed on a Microsoft Windows operating system. Fortunately, you can download from the Web and install Python into the Windows operating system the next subsections are introduced. However, before we proceed, you should know to download Python for Windows there are many alternative ways. Check and reply.

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    How to use Python to connect DB2 database

    The first step is to install Python from the official Python Web site to download it. Python's current production version is 2.6.4 and 3.1.1. After the download is complete, save the file to your hard drive, and then open the. Msi file to start the Setup program. During the installation process starts, it asks if you are available to all users or only for personal use. Use the default option Install for all users Press Next Continue. Now, will ask you to select a target directory. The default directory is similar to C: \ Python26 \; here, too, use the default value and press Next Continue. From here you will be able to custom Python installation, select the features you need to install. By default, will select all features, so use the default settings and press Next Begin the installation process. This process takes several minutes. Check and reply.

  5. #5
    Join Date
    Nov 2005
    Posts
    1,323

    How to use Python programming language to connect DB2 database

    The ibm_db extensions for Python that allows you to use Python code to connect to IBM DB2 database and interact with. To install the extension, you first need to install easy_install utility (setuptools). Navigate to the setup tools package page. To download this file to your hard drive, the download is complete an application to open it easy_install.exe install Python Scripts directory (usually C: \ Python26 \ Scripts). Install ibm_db expansion is very simple. Open a Windows Command Prompt window (Start> Run> cmd) And enter the following command, if you installed Python to other directories, to make consequential changes to references:C: \ Python26 \ Scripts \ easy_install ibm_db. Check and reply.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    How to use Python programming language to connect DB2 database

    Create a DB2 database and Python installed and configured, and ibm_db extension, you can now check if Python can connect to DB2. Open the Windows command prompt and issue python command to start the Python interpreter. At the prompt, enter the following command to connect to DB2 and calculate the country the number of rows in the table. Note that this includes the Python prompt ( "" "and ...) are only used for demonstration purposes, you can not enter them into the interpreter. Also, make sure to use your certificate to replace the actual DB2. Best of luck.

Similar Threads

  1. How to connect PHP to mySQL Database
    By Nathen in forum Tips & Tweaks
    Replies: 2
    Last Post: 17-07-2011, 03:49 AM
  2. How to connect ASP to different database
    By Elijah2010 in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 12:01 AM
  3. Connect Database to ASP.NET application
    By Ainsley in forum Software Development
    Replies: 4
    Last Post: 12-01-2010, 09:28 AM
  4. how to connect VB6 to database
    By WILTON in forum Software Development
    Replies: 3
    Last Post: 08-12-2009, 04:26 AM
  5. Download Python 3.0 / Python 3000
    By Amaresh in forum Software Development
    Replies: 6
    Last Post: 24-02-2009, 09:28 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,137,750.11912 seconds with 17 queries