If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > sever information

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-04, 04:15
davidp davidp is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
Question sever information

I'm trying to configure the setnet32 to see if we can access the informix server via java or visual c++.
We access the database via a terminal program on windows XP. All the environment variables are in scripts which run on logging in.

I'm chasing the server name, hostname, protocol - ( will be TCP) Service name. Would this info be part of the Environment variables?
I'm not sure what they mean by service. Is this the TCP/IP port number?

Thanks
David
Reply With Quote
  #2 (permalink)  
Old 03-03-04, 05:05
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Re: sever information

Quote:
Originally posted by davidp
I'm trying to configure the setnet32 to see if we can access the informix server via java or visual c++.
We access the database via a terminal program on windows XP. All the environment variables are in scripts which run on logging in.

I'm chasing the server name, hostname, protocol - ( will be TCP) Service name. Would this info be part of the Environment variables?
I'm not sure what they mean by service. Is this the TCP/IP port number?

Thanks
David
Hi David,

Your hostname & server name will be the part of you env. variables. Service is the the service name for your server. An entry for the same must be in /etc/services file. An entry for your hostname will be in /etc/hosts file.

Regards,

Lloyd
Reply With Quote
  #3 (permalink)  
Old 03-03-04, 21:13
davidp davidp is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
Thanks for the reply. I found the info but I couldn't get the connection to work. I can use DBPing and it pings the server ok if I use the ip.
I cannot connect though. Is the service http port 80 or should I use a telnet connection?

Has someone can an example of values they use to connect?

David
Reply With Quote
  #4 (permalink)  
Old 03-03-04, 21:49
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Quote:
Originally posted by davidp
Thanks for the reply. I found the info but I couldn't get the connection to work. I can use DBPing and it pings the server ok if I use the ip.
I cannot connect though. Is the service http port 80 or should I use a telnet connection?

Has someone can an example of values they use to connect?

David
Hi David,

I used the below string to connect from java.....

jdbc:informix-sqli://10.1.10.60:1530/test:INFORMIXSERVER=net;user=abc
;password=abc123

where 10.1.10.60 is my host name, an entry will be in /etc/hosts file
1530 is my service name, an entry will be in /etc/service
test is my database name. Why don't you try connecting from odbc.
You might require an Informix client sdk which includes the drivers which you can download from ibm site.

Best Regards,

Lloyd
Reply With Quote
  #5 (permalink)  
Old 03-03-04, 22:06
davidp davidp is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
Hi,

I downloaded the csdk, I'm used to programming in C++, Borland OWL and C++ builder and a little Visual C++. Only just touched on Java of late but I wanted to use the C++ lib file which I complied and build a demo of from the kit. Now I was trying to set up the server details so I can run it.

See we use 4gl to program and I was just trying to get a demo going to show we could use java/c++ instead of 4gl all the time.

Sure odbc could be an option as well but I want to be able to run SQL statements just as if I was writing in 4gl.

David


Quote:
Originally posted by lloydnwo
Hi David,

I used the below string to connect from java.....

jdbc:informix-sqli://10.1.10.60:1530/test:INFORMIXSERVER=net;user=abc
;password=abc123

where 10.1.10.60 is my host name, an entry will be in /etc/hosts file
1530 is my service name, an entry will be in /etc/service
test is my database name. Why don't you try connecting from odbc.
You might require an Informix client sdk which includes the drivers which you can download from ibm site.

Best Regards,

Lloyd
Reply With Quote
  #6 (permalink)  
Old 03-25-04, 12:36
astrue astrue is offline
Registered User
 
Join Date: Dec 2002
Location: Portland, OR, USA
Posts: 26
UNIX connectivity

Hi, David!

You're not going to be able to use ping or telnet, and port 80 isn't going to help, either. Finding the way will take a few steps. Hopefully, this will guide you through it.

On the <ASSUMPTION>UNIX database server</ASSUMPTION> is a file /etc/hosts that contains the host name of the server. It may also contain one or more aliases, a local loopback connection, and lines that identify names and aliases of other servers that he knows about. That makes it potentially confusing for you to find what you need. If you can telnet or ssh onto the server at all, try typing 'hostname', and the output will be the name of the server as he knows himself. Once again, this is assuming things about the environment (UNIX or Linux with the bash shell), so you may be searching for equivalent commands if it is using the Korn or C shells.

[root@plato /]# cat /etc/hosts
...
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.254 plato.fully.qualified.domain.com plato
...

The next thing you will need is the Informix home directory, typically something like /opt/informix. In a bash shell UNIX environment, you could find that using 'echo $INFORMIXDIR' or 'env | grep INFORMIX'.

[root@plato /]# echo $INFORMIXDIR
/opt/informix

There will be a file in $INFORMIXDIR/etc/ called 'sqlhosts'. This file creates the relationship between a server name and a given database connection mechanism. It has 4 columns of parameters in it, like so:

[root@plato /]# cat $INFORMIXDIR/etc/sqlhosts
...
plato_se sesoctcp plato ifmxsvc0
...

Look in the sqlhosts file for the server name you got from /etc/hosts. It has to be there somewhere in the 3rd column. When, you find it, look at the 1st column and the 4th column on that line. The 1st column parameter is the Informix name for that database. The 4th column parameter is the name of the service- capture that.

The name of the service has to be present at least once in the file /etc/services. Along with it will likely be a TCP and/or UDP socket declaration:

...
ifmxsvc0 1536/tcp # TLI/TCP
ifmxsvc0 1536/udp # TLI/TCP
...

So, in this case, the server plato is accessible over TCP socket 1536 by a network Informix client.

I hope this helps.

Regards,
Joe
Reply With Quote
  #7 (permalink)  
Old 04-15-04, 23:31
davidp davidp is offline
Registered User
 
Join Date: Mar 2004
Posts: 7
Thanks Joe.

That helped. Finally got to try it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On