473,800 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can Iconnect a Postgres database using odbc in c language?

I know the following java instructions for connecting a DB (oracle in
this case):

import java.sql......

try {
Class.forName(" oracle.jdbc.dri ver.OracleDrive r");
String dbUrl ="jdbc:oracle:t hin:@"+host+":" +port+":"+sid;
Connection m_connection =
DriverManager.g etConnection(db Url,user,passwd );
Statement m_statement = m_connection.cr eateStatement() ;
}
catch (ClassNotFoundE xception ex) {}

I'd like to know the equivalent instructions in C language using ODBC
for connecting a Postgres DB (with also includes library)

Please, is there anyone can tell me which these C language
instructions are?

Thanks and bye,
Maus
Nov 23 '05 #1
1 1780

On 02/07/2004 16:02 Maus wrote:
[snip]
I'd like to know the equivalent instructions in C language using ODBC
for connecting a Postgres DB (with also includes library)

Please, is there anyone can tell me which these C language
instructions are?


ODBC involves a fair bit more programming than JDBC. I suggest you search
the net for an ODBC tutorial. You can find the API documentation on
Microsoft's web site.

HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2118
by: Raymond | last post by:
Need to export an existing M$ Access 97 database to Postgres. Tuples must be filtered as I am using sequences and other constraints. Help from anyone that has experience with this or know of 3rd party automation tools would be greatly appreciated. Raymond ---------------------------(end of broadcast)---------------------------
5
8560
by: Bob Powell | last post by:
Hello everyone: Can anyone tell me if it is possible to connect excel or openoffice via odbc directly to a postgres backend database. Also, if that is possible does either OpenOffice or Excel support SQL queries to said database? Bob Powell
0
1520
by: Jesse | last post by:
Hi all, I need some help with Access database and Postgres Database i am trying to link some Acces tables to Postgres tabels but id doesn't seem to work. I have a Postgres running on a server at schoool and i have to login thru port 4040 that isn't the problem. home i use Access i have a complet database and thru the ODBC driver i
2
2680
by: Thomas | last post by:
Hi, I wish to write an MFC application to access a PostGres database which will be implemented as a Snort Database. I'm wondering if it is possible to connect to the database using an ODBC driver, and then using CRecordset classes as one would when connecting to Access. I would appreciate any information or direction that can be provided in this area. Regards
0
1338
by: Maus | last post by:
For connecting a DB (Oracle in this case) in JDBC I know the follow java instructions: Class.forName("oracle.jdbc.driver.OracleDriver"); String dbUrl = "jdbc:oracle:thin:@"+host+":"+port+":"+sid; Connection m_connection = DriverManager.getConnection(dbUrl, user, passwd); Statement m_statement = m_connection.createStatement(); Now, I'd like to know the equivalent instructions in c language using
7
1594
by: Randy Yates | last post by:
This has probably been asked before so please be gracious. I have looked on the postgres site and didn't find anything "satisfying." Is there *good* overview of postgres and associated utilities? -- % Randy Yates % "Remember the good old 1980's, when %% Fuquay-Varina, NC % things were so uncomplicated?" %%% 919-577-9882 % 'Ticket To The Moon' %%%% <yates@ieee.org> % *Time*,...
0
3218
by: kalen | last post by:
Hi, (I'm brand new to Postgres.) I'd like to set up a Postgres db/server on an XP machine, and develop apps in Visual C++ (.NET) that access the database. Should I do this using the Windows ODBC driver? If so, can you point me to web refs/sources that can help with the setup procedure. Will this limit me to SQL commands via ODBC only? (i.e. limit my use of proprietary Pg features)
0
2707
by: NM | last post by:
Hello, I've got a problem inserting binary objects into the postgres database. I have binary objects (e.g. images or smth else) of any size which I want to insert into the database. Funny is it works for files larger than 8000 Bytes. If a file is less than 1000 Bytes I get the following message: Error message: --invalid input syntax for type oid: "\074\077......";
0
2742
by: kishoramballi | last post by:
Hi, I have created table using following sql statement through psql tool in test database using create table t1(f1 int); table is created. Now I am using an odbc script to insert 5 records. But it inserts 6 records NULL value being the first one inserted. the code snippet is as below. ... ...
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.