Re: A question on Informix JDBC driver
Posted in 1998
Topics: Connectivity: ODBC / JDBC / .NET, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Security, Permissions & Auditing, Java & JDBC Development
This is a multi-part message in MIME format. --------------21A36EACCCF30737D8404CAB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This works for me. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ String url = "jdbc:informix-sqli://<host>:<port>"; Properties p = new Properties(); p.put("INFORMIXSERVER", <my_informix_server_name>); p.put("user", <user name>); p.put("password", <password> ); Connection conn = null; try { Class.forName("com.informix.jdbc.IfxDriver"); } catch (Exception e) { e.printStackTrace(); } try { conn = DriverManager.getConnection(url,p); } catch (SQLException e) { e.printStackTrace(); } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 ) Is this what do you need ? 2 ) If you want more secure programs, start writting some CORBA/IDL or RMI servers or use some signed applets. HTH, Radu Octav Chiriac wrote: > Wyan H. Jow wrote: > >> >This makes sense to me - I wouldn't want to have my user/password in > >> >clear text in my code, or developers needing to know it. Even if it's in > >> >the properties file. > >> > > >> >Problem is, going oover straight TCP, how do you do all that stuff in > >> >Java, and identify yourself to the remote db host? It seems to fit more > >> >in the java model to do it with the way that they're doing it. > >> > > >> > >> 4GL, ESQL/C does this. As I understand the server in this case > >> use rcmd authentication. What's the difference between socket > >> communications between a JAVA program and a ESQL/C program > >> > >How would Java use rcmd for remote commands/authentication? As far as I > >can guess there are two issues here: The difference between sockets in Java > >and ESQL/C = nothing and the difference between rcmd in Java and ESQL/C = > >there is no rcmd for Java. There are no environment variables in Java. > > > >I don't know what the protocol would be, but I'm assuming that there's > >some lower level stuff going on with ESQL/C on the client side that isn't > >done with Java. > > > > Well, as I know the only real problem for using authentication > by JDBC is in unsing the "reserved ports authentication scheme", i.e. > opening client sockets in the reserved port numbers area. This could > be done only by superuser. > > > > Do you know, do the 4GL or ESQL/C programs run rcmd or any other > setuid programs to open reserved ports for authentication? If they not, > this become very interesting from the security point of view. > > > > > Sorry, I don't know very well the authentication protocol > used in Informix tools. I just know they use the hosts/user equivalence > (/etc/hosts.equiv, $HOME/.rhost based) or $HOME/.netrc for authentication > using user/password description in this file. > > Best Regards, > Octav > > >> > >> >Octav Chiriac (com@netinfo-moldova.com) wrote: > >> > > >> > > >> >: Hello, > >> > > >> >: I have downloaded the Informix JDBC Type 4 driver from Intraware. > >> >: I have just started testing. > >> > > >> >: My question is about specifing connection URL. > >> >: Is there any way to connect to database server without > >> >: specifying USER and PASSWORD in connection string, so that driver (server) > >> >: will use standard UNIX authentication (as in 4GL, ISQL, DBAccess). > >> > > >> >: Thank You, > >> >: Octav > >> > > >> >: -- > >> >: Octav Chiriac Phone: (373) 2 21 20 96 > >> >: NetInfo S.R.L. Fax: (373) 2 21 20 96 > >> >: Chisinau (373) 2 24 00 83 > >> >: Moldova, Republic of mailto:com@netinfo-moldova.com > >> > > >> >-- > >> >***************************************************************** > >> >* Wyan H. Jow * > >> >* "I remember how, in college I got that part-time job as a * > >> >* circus clown and the children would laugh and laugh at me. * > >> >* I vowed, then and there, that I would get revenge." * > >> >* - Jack Handey * > >> >***************************************************************** > >> > >> -- > >> Octav Chiriac Phone: (373) 2 21 20 96 > >> NetInfo S.R.L. Fax: (373) 2 21 20 96 > >> Chisinau (373) 2 24 00 83 > >> Moldova, Republic of mailto:com@netinfo-moldova.com > >> > >\