Skip site navigation (1) Skip section navigation (2)

jdbc vs. odbc performance

From: "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
To: interfaces postgres <pgsql-interfaces(at)PostgreSQL(dot)org>
Subject: jdbc vs. odbc performance
Date: 1998-04-29 14:31:23
Message-ID: Pine.LNX.3.96.980429141042.567A-100000@proxy.bazzanese.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Hello, all

I have a performance problem. I tried the below java program to connect
with PostgreSQL.
I have a table with 8k rows and if I do a "SELECT * FROM mytable" using
JDBC it takes 50 secs of time to get all rows, using JDBC:ODBC bridge
it takes only 15 secs.
I thought JDBC was faster than ODBC.
Am I doing something wrong ?
Please help me.

I am using:
            o Linux 2.0.31
            o jdk 1.1.5
            o PostgreSQL 6.3
            o PSQLODBC.DLL 6.3 (postdrv.exe) Insight Distribution System

---------------------------------------------------------------------------
public void createConnectionDialog() {
//using JDBC:
        userNameLabel = new JLabel("User name: ", JLabel.RIGHT);
 	userNameField = new JTextField("postgres");
	passwordLabel = new JLabel("Password: ", JLabel.RIGHT);
	passwordField = new JTextField("");
        serverLabel   = new JLabel("Database URL: ", JLabel.RIGHT);
	serverField   = new JTextField("jdbc:postgresql://verde/java");
	driverLabel   = new JLabel("Driver: ", JLabel.RIGHT);
	driverField   = new JTextField("postgresql.Driver");

//using ODBC:
	userNameLabel = new JLabel("User name: ", JLabel.RIGHT);
 	userNameField = new JTextField("postgres");
	passwordLabel = new JLabel("Password: ", JLabel.RIGHT);
	passwordField = new JTextField("");
        serverLabel   = new JLabel("Database URL: ", JLabel.RIGHT);
	serverField   = new JTextField("jdbc:odbc:Sfera");
	driverLabel   = new JLabel("Driver: ", JLabel.RIGHT);
	driverField   = new JTextField("sun.jdbc.odbc.JdbcOdbcDriver");
---------------------------------------------------------------------------
                                                       Jose'


pgsql-interfaces by date

Next:From: Tom LaneDate: 1998-04-29 14:50:28
Subject: Re: [HACKERS] Re: [INTERFACES] Revised proposal for libpq and FE/BE protocol changes
Previous:From: Tom LaneDate: 1998-04-29 14:28:14
Subject: Re: [HACKERS] Revised proposal for libpq and FE/BE protocol changes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group