473,326 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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.driver.OracleDriver");
String dbUrl ="jdbc:oracle:thin:@"+host+":"+port+":"+sid;
Connection m_connection =
DriverManager.getConnection(dbUrl,user,passwd);
Statement m_statement = m_connection.createStatement();
}
catch (ClassNotFoundException 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 1752

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
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...
5
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...
0
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...
2
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...
0
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 = ...
7
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...
0
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...
0
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...
0
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....
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.