Java and DB2

Java and DB2

Post by Marius Mülle » Tue, 24 Jun 2003 02:33:46



Hi people,

i have to programm a java-code to connect to a IBM-DB2 database, but the
jdbc-driver has to use a listening-port from db2, because java tries to
connect like this way

jdbc:db2://111.222.333.444:PORT/database_name

the database and java runs on the same computer, but i dont have entered a
port for listing for statements.

Thanks for answering

 
 
 

Java and DB2

Post by Mark » Tue, 24 Jun 2003 02:34:26



Quote:> Hi people,

> i have to programm a java-code to connect to a IBM-DB2 database, but the
> jdbc-driver has to use a listening-port from db2, because java tries to
> connect like this way

> jdbc:db2://111.222.333.444:PORT/database_name

> the database and java runs on the same computer, but i dont have entered a
> port for listing for statements.

> Thanks for answering

Are you asking what the port number is?

 
 
 

Java and DB2

Post by Marius Mülle » Tue, 24 Jun 2003 03:02:44



> Are you asking what the port number is?

yes
 
 
 

Java and DB2

Post by Mark » Tue, 24 Jun 2003 03:54:58




> > Are you asking what the port number is?

> yes

Try 50000. That is the default unless it was changed.
 
 
 

Java and DB2

Post by Marius Mülle » Tue, 24 Jun 2003 04:16:54


it is not 50000.

maybe you can tell me, how i am able to look for the right port on my
db2-server
i have not change anything, but i cannot connect.

Quote:

> Try 50000. That is the default unless it was changed.

 
 
 

Java and DB2

Post by Mark » Tue, 24 Jun 2003 04:36:58




> it is not 50000.

> maybe you can tell me, how i am able to look for the right port on my
> db2-server
> i have not change anything, but i cannot connect.

On version 8, Using the Control Center, Right Click on the instance name
(such as db2inst1 or whatever is the instance name), then select "Setup
communications." Then select the "properties" for TCP/IP.

If you are using version 7 Control Center, it might be in the communications
sections of the Database Manager configuration.

 
 
 

Java and DB2

Post by Larry Menar » Tue, 24 Jun 2003 05:45:22


   See the SVCENAME parameter in the database manager configuration.  Also,
there might already be an entry for your Instance in your "services" file.
--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of All Things Natural





> > it is not 50000.

> > maybe you can tell me, how i am able to look for the right port on my
> > db2-server
> > i have not change anything, but i cannot connect.

> On version 8, Using the Control Center, Right Click on the instance name
> (such as db2inst1 or whatever is the instance name), then select "Setup
> communications." Then select the "properties" for TCP/IP.

> If you are using version 7 Control Center, it might be in the
communications
> sections of the Database Manager configuration.

 
 
 

Java and DB2

Post by Mark » Tue, 24 Jun 2003 06:07:47



Quote:>    See the SVCENAME parameter in the database manager configuration.
Also,
> there might already be an entry for your Instance in your "services" file.
> --
> Larry Menard
> IBM Workstation Database (DB2) Performance Team
> Defender of Geese and of All Things Natural

When I do a "db2 get dbm configuration" it shows the SVCENAME, but not the
port number. As I mentioned in the earlier post, the port number is viewable
via the Control Center.
 
 
 

Java and DB2

Post by Larry Menar » Tue, 24 Jun 2003 06:30:40


   Sure, no argument here.  I'm just adding more info to what has been said.
Some people shun GUIs, and prefer doing things manually.
--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of All Things Natural




> >    See the SVCENAME parameter in the database manager configuration.
> Also,
> > there might already be an entry for your Instance in your "services"
file.
> > --
> > Larry Menard
> > IBM Workstation Database (DB2) Performance Team
> > Defender of Geese and of All Things Natural

> When I do a "db2 get dbm configuration" it shows the SVCENAME, but not the
> port number. As I mentioned in the earlier post, the port number is
viewable
> via the Control Center.

 
 
 

Java and DB2

Post by Knut Stolz » Tue, 24 Jun 2003 15:51:26


Larry Menard wrote on Sunday 22 June 2003 23:30:

Quote:>    Sure, no argument here.  I'm just adding more info to what has been said.
> Some people shun GUIs, and prefer doing things manually.

... or rather scriptable and, thus, much easier to reproduce. ;-)

--
Knut Stolze
Information Integration
IBM Germany / University of Jena

 
 
 

Java and DB2

Post by Mark » Tue, 24 Jun 2003 19:00:42


Quote:> Larry Menard wrote on Sunday 22 June 2003 23:30:

> >    Sure, no argument here.  I'm just adding more info to what has been
said.
> > Some people shun GUIs, and prefer doing things manually.

> ... or rather scriptable and, thus, much easier to reproduce. ;-)

> --
> Knut Stolze
> Information Integration
> IBM Germany / University of Jena

When I run GET DATABASE MANAGER CONFIGURATION, there was no Port Number in
the output. The only way I have found to view the Port Number is via the
Control Center GUI. But maybe I missed something.
 
 
 

Java and DB2

Post by Larry Menar » Tue, 24 Jun 2003 22:36:17


   I believe DB2 does reserve a Service name for the default Instance in the
"services" file, but it doesn't necessarily put it in the DBM CFG.  So if
one is wondering what port # to use, one could look in the "services" file
to get the name/number  from there.  Or you can use a net new one if you
choose... no matter.
--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of All Things Natural


Quote:> > Larry Menard wrote on Sunday 22 June 2003 23:30:

> > >    Sure, no argument here.  I'm just adding more info to what has been
> said.
> > > Some people shun GUIs, and prefer doing things manually.

> > ... or rather scriptable and, thus, much easier to reproduce. ;-)

> > --
> > Knut Stolze
> > Information Integration
> > IBM Germany / University of Jena

> When I run GET DATABASE MANAGER CONFIGURATION, there was no Port Number in
> the output. The only way I have found to view the Port Number is via the
> Control Center GUI. But maybe I missed something.

 
 
 

Java and DB2

Post by Gert van der Kooi » Wed, 25 Jun 2003 02:08:16




Quote:> Hi people,

> i have to programm a java-code to connect to a IBM-DB2 database, but the
> jdbc-driver has to use a listening-port from db2, because java tries to
> connect like this way

> jdbc:db2://111.222.333.444:PORT/database_name

> the database and java runs on the same computer, but i dont have entered a
> port for listing for statements.

> Thanks for answering

If you are running on the same computer, you don't need the net
driver, with the 'app' driver you can use the URL
'jdbc:db2:database_name' to connect.

If you really need to access it using the net driver, make sure the
db2jd is started. By default is listens to the 6789 port.

 
 
 

1. Java and DB2 Codeset Problem

Hello,

probably this kind of problem was posted 1000 times..but please help..:(

I have;

WebSphere Application Developer
DB2 7.2
Database in UTF-8 format
System Locale: 1250 (Croatia)

All I want is to get some of my local letters in database.. but nooooo......
I know that java is working internally with Unicode and that it is
communicating with outside world with utf-8... but all I get is bunch of
???? (and some other symbols....)

Application si normal java code started directly from Websphere, not a
servlet or jsp file...an using simple INSERT sql function ..nothing more....

2. ADODB.Recordset

3. VA for Java vs DB2

4. JDBC-ODBC to Access-MDB on CDROM - Automatically installing/configuring ODBC DSN?

5. Java for DB2/400

6. Problem with password

7. java versus db2

8. Need advice on unicode

9. lightweight JDBC for java 1.0 (db2 and informix)

10. IBM Visualage for Java and DB2

11. Access App error in Visual Age Java and DB2 UDBv5

12. Java JDBC/DB2 Problem

13. java and db2