SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to connect with remote Oracle database

    Hi All,

    My application is connected to a remote Oracle Database.

    How can I write script to connect to the Oracle database? Do I need to connect to the server first? What kind of parameters I need to specify?

    Has anyone got sample script to do this?

    Thanks

    tong

  2. #2
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: How to connect with remote Oracle database

    SilkTest Online Help has all the answer to your questions. Check out DB_Connect function and other DB related topics.

    For connecting to your Remote Database, check out Control Panel/Administrative Tools (if you are using Windows 2000)/Data Sources (ODBC) and add your Data Source definitions here (your Data Source Name, Service Name, UserID, and the appropriate ODBC Driver).



    [This message has been edited by Gilbert (edited 03-21-2001).]

  3. #3
    pt
    pt is offline
    Member
    Join Date
    Feb 2001
    Location
    US
    Posts
    43
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to connect with remote Oracle database

    make sure that u have the DSN setup which is done in the ODBC sources in control panel. try pinging the server. U can also use the script given below


    this is just an example ..... u can also use the server name with the User ID & Password for the connection, check DB_connect statement in help
    ------------------------------------------

    [ ] HDATABASE hdbc
    [ ] HSQL hstmnt
    [ ] INTEGER id, recordid
    [ ] STRING sDeptName, driver, sExpectedValue, sTestValue
    [ ] BOOLEAN status


    [-] // connect to Postgresql
    [ ] hdbc = DB_Connect ("dsn=dsn name")

    [-]
    [ ] // retrieve info from Department table
    [ ] hstmnt = DB_ExecuteSql (hdbc, "SELECT * FROM aduser")
    [ ]
    [-] // process the information that came back

    [-] print ("Here’s the info in the Department table:")
    [ ] print ()
    [ ] while (DB_FetchNext (hstmnt, recordid))
    [ ] print ("Dept: {recordid} ")
    [ ] // release resources (unneeded really
    [ ] // because immediately followed by disconnect)
    [ ] DB_FinishSQL (hstmnt)
    [ ] // disconnect
    [ ] DB_Disconnect (hdbc)
    [ ]
    [ ] //disconnect all the connections
    [ ] disconnectall ()
    [ ]


    [This message has been edited by pt (edited 03-21-2001).]

    [This message has been edited by pt (edited 03-21-2001).]
    P.T.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:17 AM.

Copyright BetaSoft Inc.