Solved

How to connect the Oracle Database Manually thro PB application

Posted on 2009-07-01
4
508 Views
Last Modified: 2013-12-26
I want to connect the Oracle DB manually through my Powerbuillder application. That is Whenever user run my application DB should start automatically. If they close my application then the DB should shutdown automatically.
Now I have wrote batch file to connect the Oracle DB run the batch file in the Open event of my application to start the DB. Run the batch file in close event of my application to shutdown the DB by calling the Run() function.
1. But it showing the command prompt window. I dont want to show the comand prompt window.
2. Once the TNSListener service started then the application started. but I dont want this. Actually I want once all the other services (like Oracle Agent etc..) started then only my application should start.

Please help me to solve this problem
0
Comment
Question by:gajmp
4 Comments
 

Expert Comment

by:Treety_Patnaik
Comment Utility
1> Create a ODBC for ur oracle database.
2> Then open your pb database profile there create a new profile under ODBC and set ur ODBC profile name. Aftre that just test your connection.
0
 
LVL 14

Expert Comment

by:shru_0409
Comment Utility
The application open event code should look like below,
// Profile EAS Demo DB V3
SQLCA.DBMS = "ODBC"
SQLCA.Database = "EAS Demo DB V3"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=EAS Demo DB V3;UID=dba;PWD=sql'"

Connect Using SQLCA; //This line is important to connect to ur database

open(w_customer)
0
 
LVL 3

Author Comment

by:gajmp
Comment Utility
Sorry...one mistake in my Question. I want to start my DB first and then only will connect.  My requirement is want to start and shutdown the DB automatically without any user intervene.
regarding connection I already complete those steps.. My application should start and shutdown the DB automatically
0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
Comment Utility
Use Run and Wait utility from this link. Very nice userobject with windows api.

http://www.topwizprogramming.com/freecode_runandwait.html

you can run any exe or bat file in silent mode and can wait until execution of it completes.

Let me know if you couldn't figure out how to use it.

Regards,
Sandeep
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now