I've created the Informix database as described in my previous question (Create Informix database). Now I need to have JDBC access to it. How should I configure the Informix database server?
I can create a database, tables, and run any queries via dbaccess
utility.
I've attempted to connect to it via JDBC with the following connection string (test
database was created by dbaccess
):
jdbc:informix-sqli://localhost:8202/test:INFORMIXSERVER=myserver;user=informix;password=1111;
The result is:
Connection refused java.net.PlainSocketImpl.socketConnect (PlainSocketImpl.java:-2)
Ok, since user=informix
and password=1111
are local Linux user and password, it looks like I have to add a user
properly.
So, I've changed in $INFORMIXDIR/etc/onconfig
the string
from USERMAPPING OFF
to USERMAPPING ADMIN
.
Then I connected to test
database via dbaccess
and create user according to CREATE USER statement doc:
CREATE USER mary WITH PASSWORD "joebar" PROPERTIES UID 44567 GROUP(1234)
Again, no success with it:
jdbc:informix-sqli://localhost:8202/test:INFORMIXSERVER=myserver;user=mary;password=joebar;
The result is the same:
Connection refused java.net.PlainSocketImpl.socketConnect (PlainSocketImpl.java:-2)
Furthermore, I can't use this user to connect via dbaccess
.
Literally:
dbaccess
DBACCESS >>
ConnectionCONNECTION >>
ConnectSELECT DATABASE SERVER >>
myserverUSER NAME >>
[RETURN] (type nothing)SELECT DATABASE >>
choose test@myserver
The result is: Database selected.
But if I'm trying to use created user:
dbaccess
DBACCESS >>
ConnectionCONNECTION >>
ConnectSELECT DATABASE SERVER >>
myserverUSER NAME >>
maryPASSWORD >>
joebarSELECT DATABASE >>
choose test@myserver
The result is:
387: No connect permission.
111: ISAM error: no record found.