Sponsored Content
Top Forums Programming Trubble in executing the cpp program... Post 302249314 by calv on Tuesday 21st of October 2008 06:02:51 AM
Old 10-21-2008
Either the constructor of Connection, or the Query() method throws an exception of type const char *. You can catch it, by enclosing the calls with try, and adding a catch block, like:

Code:
try {
    Connection DbConnection(Host, Database, UserId, Password);
    query="select * from the test"; // test is my database
    result = DbConnection.Query(query); // perform the required database operation..
}
catch (const char *errmsg)
{
    std::cerr << "error message from connection: " << errmsg << "\n";
    return 1;
}

 

10 More Discussions You Might Find Interesting

1. Programming

executing a program within a program

Read the title: how do i do it? (4 Replies)
Discussion started by: Gekko
4 Replies

2. UNIX for Dummies Questions & Answers

executing the su command from a java program.

Say in unix (AIX) m/c, I am logged in with s1 user and want to start process p1 with user credentials of s2. I can do manually in this way: #su - s2 #enter password for s2> somePassword $ p1 But all this I have to do through a java program. How to pass the password through program. One... (1 Reply)
Discussion started by: shailendrat
1 Replies

3. Programming

Executing an .ec program in different informix versions

Hi all, I tried writing an .ec program connecting to informix database from solaris platform Sun 5.7 informix version that i had to used when i compiled the program was 9.21.UC3 the binary when i ported solaris box with informix version 9.40.UC5 i am unable to run that i am encountering... (0 Replies)
Discussion started by: matrixmadhan
0 Replies

4. Shell Programming and Scripting

convert cpp program to c shell script ?

Hi guys I tried to convert this c++ code to c shell script but there are some bugs and I don't know how to solve it. This code prints the three variables in decreasing order: int main() { int x,y,z; cin >> x >> y >>z; if ( x < y ) if ( x < z ) if ( y < z ) cout << x <<" " <<... (2 Replies)
Discussion started by: domain
2 Replies

5. Solaris

How to know the size of the program currently executing in memory

hey everybody, i am currently working on solaris 10 os on a m5000 server. my problem is when i want the exact size of a program in execution, i am unable to do it. earlier i thought the RSS field of prstat but because of its large size it cant be the size. pmap -x shows some output but it includes... (2 Replies)
Discussion started by: aryansheikh
2 Replies

6. Shell Programming and Scripting

Executing a Java Program

I am entirely new to shell scripting and would like to create a script to execute a java program called Main. I've already compiled it and placed the .java and .class files at /root/javaTest. Next I made a shell script that simply contained: java /root/javaTest/Main . I made the script... (2 Replies)
Discussion started by: hypnotic_meat
2 Replies

7. Shell Programming and Scripting

Executing WIN32OLE program

Hello, Please help me out to execute this perl program: #!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # die on errors... # get already active Excel application or open new my... (6 Replies)
Discussion started by: suvenduperl
6 Replies

8. UNIX for Dummies Questions & Answers

executing a different program

What system calls or commands do I need to use in order to execute a different program from an already running process? (1 Reply)
Discussion started by: justOne21
1 Replies

9. Programming

Error with shared lIBMpi.so.1 when compiling CPP program

Hello, Met a problem when compiling a C++ program from source code without error, but when ran it there was always an error message: ./Ray: error while loading shared libraries: libmpi_cxx.so.1: cannot open shared object file: No such file or directoryAs the error points to openmpi which was... (0 Replies)
Discussion started by: yifangt
0 Replies

10. Programming

Error in executing the C program

Hello Friends, I have written a code for the unisex bathroom which makes a policy that when a woman is in the bathroom only other women may enter, but not men, and vice versa. This program consists of four functions which a user defines but these functions are not properly working while... (4 Replies)
Discussion started by: Ravi Tej
4 Replies
std::placeholders(3)					     Library Functions Manual					      std::placeholders(3)

NAME
std::placeholders - SYNOPSIS
Variables const _Placeholder< 1 > _1 const _Placeholder< 10 > _10 const _Placeholder< 11 > _11 const _Placeholder< 12 > _12 const _Placeholder< 13 > _13 const _Placeholder< 14 > _14 const _Placeholder< 15 > _15 const _Placeholder< 16 > _16 const _Placeholder< 17 > _17 const _Placeholder< 18 > _18 const _Placeholder< 19 > _19 const _Placeholder< 2 > _2 const _Placeholder< 20 > _20 const _Placeholder< 21 > _21 const _Placeholder< 22 > _22 const _Placeholder< 23 > _23 const _Placeholder< 24 > _24 const _Placeholder< 25 > _25 const _Placeholder< 26 > _26 const _Placeholder< 27 > _27 const _Placeholder< 28 > _28 const _Placeholder< 29 > _29 const _Placeholder< 3 > _3 const _Placeholder< 4 > _4 const _Placeholder< 5 > _5 const _Placeholder< 6 > _6 const _Placeholder< 7 > _7 const _Placeholder< 8 > _8 const _Placeholder< 9 > _9 Detailed Description ISO C++11 entities sub-namespace for functional. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Jun 10 2014 std::placeholders(3)
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy