JDBC in Linux
Since JDBC is a bridge to connect Java and Oracle via ODBC.
However, in Linux, there is not ODBC. Can I still use JDBC in
linux to access Oracle?
null
Stephen (guest) wrote:
: Since JDBC is a bridge to connect Java and Oracle via ODBC.
: However, in Linux, there is not ODBC. Can I still use JDBC in
: linux to access Oracle?
JDBC is NOT a bridge between JDBC and ODBC! Early versions of
JDBC might have used this to get a version out there for people
to use to code.
Oracle JDBC connects either thin (100% java) or OCI (via the
Oracle Client)
null
Similar Messages
-
ODBC or JDBC on Linux/Oracle
http://www.openlinksw.com/
Is where you will find connectivity for LINUX and Oracle.
I did some research on the connectivity of LINUX and Oracle
after having switched from a Server Farm hosting IIS and then
going to linux.
The basic info I found was in about 20 links.
Some areas of interest might be:
http://www.linuxworld.com/ this is by INFOWORLD MAG but has the
best source and links for commercial Linux.
In addition:
http://users.ids.net/~bjepson/freeODBC/
The free ODBC might be a place to gain the functionality to get
the job done if you have the ability to code at that layer.
The reason WHY odbc is not the preferd method of accessing
Oracle is that OLE DB is thunked through the JET DATABASE ENGINE
or subsystem in WIN9.x and WINNT at the client side.
http://support.microsoft.com/support/kb/articles/q139/7/25.asp
This article goes into some detail how OLE DB, ODBC, ADO, RDO,
and the rest of the MSFT data is handled and by what files.
ORACLE uses "OLE OBJECTS" to get the data and passes the JET
DBENGINE/Sub-system.
So for a Server on Linux and a host on Wintel you might look at
the JDBC or universal Model of data connectivity.
Oddly this was just something I looked into prior to deciding to
get into Oracle8i....
If you get any additional info.. or other "workable" approaches..
Please follow up I would be interested...
nullHave you ever heard of [url http://www.google.com]google?
By searching for [url http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=linux+mysql+jdbc+driver]linux mysql jdbc driver, and following the first link, it took me about two minuts to find the [url http://www.mysql.com/downloads/api-jdbc-stable.html]MySql JDBC driver download page. -
Dear All,
I want to install JDBC for JDK1.6. I have installed the JDK; now please let me to know how to install JDBC on Linux for JDK1.6.
Thanks & Regards,
Aqeel NawazHi Aqeel,
Download the ojdbc.jar file for your database and add it to your CLASSPATH. -
Need help with Kerb. jdbc from Linux to MS SQL 2008
Hello Forum, I am getting an erro when I try to use Kerb. trusted security to connect to sql server.
4.0 documentation reflects it's absolutely possible.
Not only that, I have ms odbc installed on the same box and it provides Kerbers (not ntlm) connection to sql server. But java with jdbc reject doing it.
Here is the message:
com.microsoft.sqlserver.jdbc.SQLServerException: Integrated authentication failed. ClientConnectionId:5836ac6c-6d2e-42e4-8c6d-8b89bc0be5c9
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667)
at com.microsoft.sqlserver.jdbc.KerbAuthentication.intAuthInit(KerbAuthentication.java:140)
at com.microsoft.sqlserver.jdbc.KerbAuthentication.GenerateClientContext(KerbAuthentication.java:268)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2691)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
at java.sql.DriverManager.getConnection(DriverManager.java:419)
at java.sql.DriverManager.getConnection(DriverManager.java:367)
at connectURL.main(connectURL.java:53)
Caused by: javax.security.auth.login.LoginException: unable to find LoginModule class: com.sun.security.auth.module.Krb5LoginModule
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:834)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:209)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:709)
at java.security.AccessController.doPrivileged(AccessController.java:327)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:706)
at javax.security.auth.login.LoginContext.login(LoginContext.java:603)
at com.microsoft.sqlserver.jdbc.KerbAuthentication.intAuthInit(KerbAuthentication.java:133)
1] Client side:
Which OS platform are you running on? (Linux)
Which JVM are you running on? (IBM J9 VM (build 2.6, JRE 1.6.0 Linux amd64-64
What is the connection URL in you app? (jdbc:sqlserver://abcde24243.somebank.COM:15001;databaseName=master;integratedSecurity=true;authenticationScheme=JavaKerberos)
If client fails to connect, what is the client error messages? (see above)
Is the client remote or local to the SQL server machine? [Remote | Local]
Is your client computer in the same domain as the Server computer? (Same domain | Different domains | WorkGroup)
[2] Server side:
What is the MS SQL version? [ SQL Sever 2008]
Does the server start successfully? [YES ] If not what is the error messages in the SQL server ERRORLOG?
If SQL Server is a named instance, is the SQL browser enabled? [NO]
What is the account that the SQL Server is running under?[Domain Account]
Do you make firewall exception for your SQL server TCP port if you want connect remotely through TCP provider? [YES ]
Do you make firewall exception for SQL Browser UDP port 1434? In SQL2000, you still need to make firewall exception for UDP port 1434 in order to support named instance.[YES | NO | not applicable ]
I currently can login from client using ms odbc sqlcmd (linux) version with trusted Kerberos connection.
which tells me there is no problem with firewall.
Tips:
If you are executing a complex statement query or stored procedure, please use execute() instead of executeQuery().
If you are using JDBC transactions, do not mix them with T-SQL transactions.
Last but not least:
geneSaeed,
Not being versed in JAVA, I'm not sure what you're telling me. Can you tell me if this looks good? BTW, I did find out that JDBC is installed on the server as part of Coldfusion and this is what I was told:
macromedia.jdbc.oracle.OracleDriver is 3.50
macromedia.jdbc.db2.DB2Driver is 3.50
macromedia.jdbc.informix.InformixDriver is 3.50
macromedia.jdbc.sequelink.SequeLinkDriver is 5.4
macromedia.jdbc.sqlserver.SQLServerDriver is 3.50
macromedia.jdbc.sybase.SybaseDriver is 3.50
Below is what I think will work, but I know it won't because of the semi colons. Can you help me fix it?
I've the things that I think need changing are in bold.
Thanks!
======
private void dbInit()
dbUrl = "jdbc:odbc:DRIVER={SQL Server};Database="DATADEV";Server=VS032.INTERNAL.COM:3533;", "web_user";
try
Class.forName("macromedia.jdbc.sqlserver.SQLServerDriver ");
catch(Exception eDriver)
failedDialog("Driver failed!", eDriver.getMessage());
private void dbOpen()
if(paramServerIP.indexOf("datadev") >= 0)
dbPswd = "password";
else
dbPswd = "password";
try
dbCon = DriverManager.getConnection(dbUrl, paramDbUserStr,
dbPswd);
dbStmt = dbCon.createStatement();
dbStmt.setEscapeProcessing(true);
catch(Exception eDbOpen)
failedDialog("Failed to open db connection!",
eDbOpen.getMessage());
private void dbClose()
try
dbStmt.close();
dbCon.close();
catch(Exception eDbClose)
failedDialog("Failed to close db connection!",
eDbClose.getMessage());
} -
Random SQLExceptions in JDBC on Linux
I have a test program that connects to a remote database from my Linux system(Red Hat 6.2) using the 8.1.6 JDBC thin driver. It loops 100 times, calling a function which does a simple select from a table. Approximately 20% of the time, I get an SQL Exception, either an ora-00942(table or view does not exist), ora-00933(invalid table name), ora-00933(SQL command not properly ended), or ora-00911(invalid character).
If I run this same program from Windows2000 or from a Solaris system, it never gets an SQL Exception. So, it appears to be Linux related. Have compiled and run the program with Java 1.2 and 1.3. Any ideas or suggestions? Following is the test program:
import java.sql.*;
import java.text.*;
import java.util.*;
import java.io.*;
* testQuery will attempt to reproduce a problem
class testQuery {
private static String sessionName = "[email protected]";
private static int exceptionCount = 0;
private static Connection dbconn = null;
static public void main (String args[]) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException cnf) {
System.out.println("main: oracle driver class not found");
return;
try {
dbconn = DriverManager.getConnection("jdbc:oracle:thin:@myhost:1521:mydb","user", "passwd");
} catch (SQLException e) {
System.out.println("main: SQL Exception getting connection: " + e.getMessage());
if (dbconn == null) {
System.out.println("main: null connection");
return;
for (int i=0; i<100; i++) {
doQuery(sessionName, i);
System.out.println("Main program complete: there were " + new Integer(exceptionCount) + " SQL exceptions");
static public boolean doQuery(String name, int i) {
PreparedStatement pstmt = null;
try {
pstmt = dbconn.prepareStatement("select session_id from sessions where name = ?");
pstmt.setString(1,name);
pstmt.executeQuery();
System.out.println("Query <" + new Integer(i) + "> SUCCESSFUL!");
} catch (SQLException e) {
System.out.println("SQL Exception caught on query<" + new Integer(i) + "> : " + e.getMessage());
exceptionCount++;
} finally {
try {
pstmt.close();
} catch (SQLException e) {
System.out.println("SQL Exception caught on close: " + e.getMessage());
return true;
}nullin that list of products i would have to say your open office will be your limiting factor, how fast do you want to do your spreadsheets or wordprocessing?
depending on the version of linux and sql, i've run it very successfully on a pentium 1 200 with 256 MB of ram. -
JDBC DRIVER LINUX TOMCAT APACHE
Hello all
I am woking on APACHE + TOMCAT + RH LINUX
enviorment . I have a main page which calls another JSP on clicking to a button . That JSP makes connection with oracle 7.3.4 which is running on another machine whose enviorment is AIX 4.2 .
whenever I clicked on button it access the JSP but it could nt find the driver which is classes12.zip in
TOMCAT_HOME/lib directory and classpath is already set
Error I am getting is driver not found in case the statement is
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
and error is Document contain no data in case I change the above statement to
Class.forName("oracle.jdbc.driver.OracleDriver");
Please help ?
Thanks in Advance
AviThanks for yor reply beattris
Still it didbnt work Please have a look at the code
<%
System.out.println("1");
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("2");
conn = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@blackadder:1521:ORCL","driver","norman");
stmt = conn.createStatement();
rs = stmt.executeQuery("SELECT FILE_STATUS FROM GOLFFILES WHERE GOLFFILE_ID = (SELECT MAX(GOLFFILE_ID) FROM GOLFFILES)");
while (rs.next()) {
varIsUpdated = rs.getString(1);
rs.close();
stmt.close();
if (varIsUpdated.equals("START") && !(varIsUpdated.equals("LOADED"))) {
conn.close();
%>
Above is the code it comes to JSP and it prints 1 which is above the class.forName statement but after that it wont print 2 .. which means it is able execute this statement
One more thing do .zip files work on linux
Please see if u can help ?
Thanks
KS -
How to do connectivity to JDBC on Linux platform
Hello friends!
I am novice user of JSP & JDBC. I dont know how to make connectivity with database using JDBC driver and that is using Linux paltform. I read one tutorial for that they have given some code. But they have used <% import java.sql%> . The database I am using is PostgreSQL. So how to do that?
Plese help me ! Thank you in advance!Same as JDBC on any other platform. Java and JDBC are OS independent.
The java.sql package is part of the JDK, of course. No action required.
If you're using PostgreSQL, you have to get their JDBC driver JAR and put it in your app's CLASSPATH.
Then you should review this.
% -
I have an urgent query . I have written a java code on microsoft platform that talks with SQL server 2000 hosted on windows200 machine in a network using JDBCODBC driver wothou using a Data source name.
But this same code when i try to run on mandrake linux throws an exception as
java.sql.SQLException: [unixODBC] [Driver Manager] Data source name not found,
and no default driver specified.MS provides a JDBC driver for MSSQL 2000, go to there site and download it.
-
Hi,
I am running a servlet program on linux that retrieves some information from oracle database using jdbc.
I can run a normal java application also on linux with a database connection:
Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:oci:@dbname", "username", "pswd");
For the same code above I have not been able to retrieve data from the same oracle database name.
I do not understand why I can use jdbc in a normal java program, but not in a servlet program.
Could someone please explain the problem to me?
ThanksThe alternative is to use the Sun rmic, which you'll find (probably) lives somewhere near javac, javap, javah et cetera.
You are not using the sun rmic, as the stacktrace shows.
Dont just tell us that your 'paths are all correct' - post the invocation of the compiler that causes the stacktrace, along with some environment, then you might get some more detailed help -
Oracle9i jdbc on linux with Sun App Server7
Hello all,
I'm having trouble setting up oracle9i jdbc drivers on linux. I downloaded ojdbc14.jar from oracle's download site and put it in sun/domains/domain1/lib. I also added the jar file in the server classpath suffix, but somehow the connections are not going through. I wrote a simple java test application to test the drivers and that works perfectly. It's just the server that's not being able to connect for some reason. Any ideas? I use thin connection.Yes, here it is (I use CMP beans):
Exception thrown from bean; nested exception is: com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
NestedException: java.sql.SQLException: Error in creating connection
com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
NestedException: java.sql.SQLException: Error in creating connection
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:864)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:780)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:667) -
When I use Employee.java from JDBC examples I get:
SIGSEGV received at bffff470 in /home/ora/app/oracle/product/8.0.5/lib/liboci805jdbc.so. Processing terminated
Writing stack trace to javacore11569.txt ... OK
Aborted
How solve this problem?
nullThanks.
Where I can get 8.1.6 client for Linux?
Next question:
I try run examples on Windows NT 4.0
(Oracle 8.1.5, Sun J2SE)
Connection conn =
DriverManager.getConnection ("jdbc:oracle:oci8:@", "SCOTT", "TIGER");
In result error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: make_c_state
at oracle.jdbc.oci8.OCIDBAccess.make_c_state(Native Method)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:197)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:142)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:214)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:193)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at Employee.main(Employee.java:43)
How solve this trouble?
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDBC Development Team:
The problem is that prior to 8.1.6 the OCI drivers are not supported using any VM other than Sun's. So, you have to do one of the following: upgrade to 8.1.6 client, switch to Sun's VM, or use the Thin driver.
The reason that IBM and MS's VMs are not supported is that they do not support NMI and prior to 8.1.6 the OCI driver uses NMI to maintain JDK 1.0.3 compatibility. We dropped support for JDK 1.0.3 in 8.1.6 and switched to JNI. The 8.1.6 drivers are supported on IBM's and MS's VMs.<HR></BLOCKQUOTE>
null -
Jdbc for linux.....
hi......
i have a prob in my authentication part of an application which iam developing..
firstly, I use mandrake linux 9.1 which has the mysql database which is the default database.....
I want retreive the username & passwd from database to compare it with the values entered by the users....
how do I have to do this & what is the odbc connection should I use???
P.S::
plz tell me the odbc to be used which is enough as I know how to do the codings.......
Thanx...hi,,,,,,
thanxz for the valuable reply...
i downloaded the zip file.. i extracted it.. can any one tell me how to make link with the database & work properly.. i tried executing the program, i get an error
classNotFound exception :com.mysql.jdbc.Driver
i think something went wrong in the connection....
plz be clear to solve this problem as iam new to this....
thanxz -
Hi All,
I am currently set up the (tomcat) jsp engine on top of apache web server.
And now i would like to install both sqlj and a jdbc driver such
that I can query our oracle database. In all of the options for downloads
there is a windoze option and a solaris option. Do I have to wait for specific
"linux" version to get them to work. Or is the solaris option alright
for linux ??
slightly confused,
ChrisUnfortunately, this description is still rather unspecific.
It sounds, as if there might be an issue with the way database connections are established for the SQLJ and JDBC parts of your program. Could you provide more information on that, specifically on how you obtain JDBC connections and SQLJ connection contexts. -
JDBC + Mandrake Linux + Mysql + netbeans
I'm trying to conecto to a mysql server using the following code of netbeans. It compiles, but I got a java.lang.NoClassDefFoundError on execution time.
Does anyone have any clue of how to solve it?
(I got the netbeans+sdk package, is it complete? Maybe the jdbc class is missing? Where can I get it?)
Thanks!
import java.sql.*;
public class Connect
public static void main (String[] args)
Connection conn = null;
try
String userName = "root";
String password = "kron9013";
String url = "jdbc:mysql://192.168.0.109/Solbet";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
catch (Exception e)
System.out.println (e.toString());
System.err.println ("Cannot connect to database server");
finally
if (conn != null)
try
conn.close ();
System.out.println ("Database connection terminated");
catch (Exception e) { /* ignore close errors */ }
Exception in thread "main" java.lang.NoClassDefFoundError: mysql/Connect (wrong name: Connect)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)On this line:
Class.forName ("com.mysql.jdbc.Driver").newInstance ();I'm 99.99% sure you can drop the newInstance() part. However, I'm not certain if that's why it's failing. -
Installing ODBC/JDBC on Linux
Anyone know of a quick method to install the necessary drivers for DBI on Linux.
I wish to connect to an NT Oracle DB from my Linux box using perl...Hi,
1. The installation for OBIA 7964 is same as OBIE 7963 except the version difference of the tools like OBIEE. Follow the standard installation document. it will be better.
2.No need to upgrade Webcatalog. you have to copy the catalog from 7963 server and paste in the location, deploy and restart all services then it will start working
3. For RPD, copy the RPD from OBIA 7963 server. open the Admin tool in OBIA 7964 server and open the RPD(OBIA 7963 RPD) in the Admin too 7964 server and save it in the desired location(Desktop). Then the latest RPD is ready , you can deploy the RPD and start working with the 7964.
Regards,
Selvam.M
Maybe you are looking for
-
Dear all, I've created out BI system in our new Portal installation and tested the connection. Everything works fine. I added the certificate of the portal to STRUSTSSO2 in BI ABAP and assigned SAP_ALL and SAP_NEW to my Account.in BI. If I open the i
-
Request in Production server for Master data
Hi, In Production server when we try to hire an employee through PA40, it is giving an error saying that "Client XXX has status 'not modifiable", Choose 'Display object' or 'Cancel'. I think it is asking for a request, because of settings in SCC4,is
-
Help::algorithm tls not available
i am using the j2se1.4.2.03 when i start tomcat ,the error accor: java.io.IOException:algorithm tls not available lefecycleException: Protocol handler start failed: java.io.IOException:algorithm tls not available the server.xml: <Connector port="8443
-
Master Thesis in SAP Business Intelligence Area
Hi , This is Mohsin , i am doing my Masters program in Software Engineering and i am quiet curious about pursuing my Masters thesis in Business intelligence area , could anyone please guide which is the best area to go for the thesis. Any direc
-
Outlook 2007 no longer notifies me of calendar events with iCloud
Since installing iCloud and merging calendars, I don't get the normal popup notifications for calendar events. My Outlook calendar is now blank and all the events are on the iCloud calends but no notifications show.