JDBC connect to dabase fails, OK using ODBC
9 Message(s) by 6 Author(s) originally posted in java databases
| From: kmaule |
Date: Tuesday, July 31, 2007
|
Hi there,
Newbe here. I'm unable to
connect via
JDBC using OpenOffice 2.2.1
Base to an
Informix 7.01 UC1 std edition
database . My Classpath is
correct and passes the connection test. Using a known good user name/
password to a known good database fails with "Database not found or no
system permission" -329
error . I can connect OK via
ODBC to this same
database with same credentials. Is there anything on the DB
server
that may need to be done to enable JDBC connectivity?
Cheers,
Kirk
| From: kmaule |
Date: Tuesday, July 31, 2007
|
Further info: The error we are getting is a -329 "Database not found
or no system permission". Also saw a 956 error "Client
host or user
com.informix.asf.IfxASFRemoteException: (root@xxxxxxxxxxx) isn't trusted
by the server"
| From: Roedy Green |
Date: Tuesday, July 31, 2007
|
wrote in message,
quoted or indirectly quoted someone who said :
Newbe here. I'm unable to connect via JDBC using OpenOffice 2.2.1
Base to an Informix 7.01 UC1 std edition database. My Classpath is
correct and passes the connection test. Using a known good user name/
password to a known good database fails with "Database not found or no
system permission" -329 error. I can connect OK via ODBC to this same
database with same credentials. Is there anything on the DB server
that may need to be done to enable JDBC connectivity?
In ancient China it was considered improper for a doctor to examine a
female patient. This must have made for some strange diagnoses. You
are doing the analogous thing. Post your
code . see
http://mindprod.com/jgloss/sscce.html
--
Roedy
Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
| From: Lothar Kimmeringer |
Date: Tuesday, July 31, 2007
|
wrote in message:
Post your code.
As far as I understand the OP he has the problem while working
with OpenOffice. So I rather doubt that there is any.Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@xxxxxxxxxxx
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!
| From: Lothar Kimmeringer |
Date: Tuesday, July 31, 2007
|
wrote in message:
I'm unable to connect via JDBC using OpenOffice 2.2.1
Base to an Informix 7.01 UC1 std edition database.
You better should ask in a Newsgroup covering OpenOffice.
The code OO is using might be JAVA, but the exact way
what can fail and where to look at to find out can only
be told by people knowing OpenOffice (and JAVA ;-).Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@xxxxxxxxxxx
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!
| From: IchBin |
Date: Wednesday, August 01, 2007
|
wrote in message:
wrote in message:
I'm unable to connect via JDBC using OpenOffice 2.2.1
Base to an Informix 7.01 UC1 std edition database.
You better should ask in a Newsgroup covering OpenOffice.
The code OO is using might be JAVA, but the exact way
what can fail and where to look at to find out can only
be told by people knowing OpenOffice (and JAVA ;-).
Regards, Lothar
Some time last year OpenOffice changed its
DBMS Base
component to use
HSQLDB which is written in JAVA and an
open source product. As mentioned
in other threads you need to provide the JDBC code you've written to
determine the problem. Also, as stated before in this thread, this is an
OpenOffice issue.
--
Thanks in Advance...
http://weconsulting.org
IchBin, Philadelphia, Pa, USA
http://ichbinquotations.weconsulting.org
______________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
| From: kmaule |
Date: Thursday, August 02, 2007
|
It turns out the issue was much simpler. The JDBC connection
URL was
incorrect as the value for informixserver= was set to the server's
host name and not the
logical server name.
Thanks for the replies!
Kirk
| From: dilip |
Date: Friday, August 31, 2007
|
wrote in message:
Hi friends,
myself dilip here are the following code for JDBC Connectivity.
Use that
sample code according to your database name.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:
<DSN_NAME>","User_Name","Password");
Statement st=con.createStatement();
above code may solve your difficulty hopefully.
Thanks,
Dilip Kuamr
http://www.intelcs.com/IT-Companies/
| From: Lew |
Date: Friday, August 31, 2007
|
wrote in message:
wrote in message:
Hi friends,
myself dilip here are the following code for JDBC Connectivity.
Use that sample code according to your database name.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:
<DSN_NAME>","User_Name","Password");
Statement st=con.createStatement();
above code may solve your difficulty hopefully.
Just to add to dilip's good advice, notice that he's given you just the basic
method calls. You've to add
exception handling (forName() can throw various
exceptions such as ClassNotFoundException, createStatement() can throw
SQLException, ...). You need a finally{}
block after your access code to
close the connection. In other words, dilip gave you a signpost, not a road.
Oh, and prefer prepareStatement() to createStatement(). The latter has
security vulnerabilities (google for "SQL
injection attack"), and most
database engines (I'm not sure about MySQL) can
optimize the former.
--
Lew
Next Message: JAVA.sql.SQLException: JAVA.sql.Time
Blogs related to JDBC connect to dabase fails, OK using ODBC
since the days of MS-DOS Word Perfect) to (Post office web site)
Connect.
java import
java.awt.*; import
java.sql.*; /** Load a driver and
connect to a
database. */ public class
Connect { public static void main(String[] av) { String dbURL = “
jdbc:
odbc:Companies”; try { // Load the
jdbc-
odbc bridge
...