Urgent query JDBC on linux
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.
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. -
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?
nullStephen (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 -
How to notify in case SQL query(JDBC sender adapter) does not fetch records
hi,
How can we notify(by alerts or something) in case SQL query(JDBC sender adapter) does not fetch records? In channels logs it only says processing started & finished(no message is created for same).
Thanks,
MayankHi,
1 ) What is exact audit log message ?
2) Try fetching the count in SQL statement if there are any valid records it will give the count.
May for testing you can use <TEST> in update statement.
3) Have you used taskTimeout parameter ?
4) Are multiple channels polling on same table ?
regards
Ganga -
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. -
Urgent query about copying array of objects to html item
I have an urgent query about how I can display an array of objects on a html form. The only suitable html item I can see for this is a drop down box. Ideally a combo box would be preferable but I cant find anything like this. Basically the display item needs to contain 3 columns of data and has to display a number of rows. Can anyone tell me how to copy the array of values into a drop down box?
Here is all the code from my jsp. It keeps returning null:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page import="java.util.*, java.lang.*" %>
<html:html locale="true">
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
<link rel="stylesheet" type="text/css" name="timesheet" href="stylesheets/timesheet.css"></link>
<script type="text/javascript" language="javascript" src="javascript/sum.js"></script>
<title><bean:message key="eng.title"/></title>
<html:base/>
</head>
<body bgcolor="white">
<table border="0" width="100%">
<tr>
<td width="30%"><html:img page="/images/PwC_logo.gif"/></td>
<td width="40%" class="applicationTitleCell">
<div align="center">
<bean:message key="application.title"/>
</div>
</td>
<td width="30%"> </td>
</tr>
</table>
<center>
<html:form action="/selectEng" focus="engSearchNumber">
<table border="0" width="100%">
<tr>
<td width="30%"></td>
<td width="20%" align="center"> <b> <bean:message key="eng.prompt.engSearchNumber"/> </b> </td>
<td width="20%" align="center"> <b> <bean:message key="eng.prompt.clientSearchName"/> </b> </td>
<td width="40%"> </td>
</tr>
<tr>
<td width="30%"></td>
<td width="20%" align="center"> <html:text property="engSearchNumber" size="20" maxlength="9" onchange='<%= "SearchLength(this)" %>' onkeypress="return NumberOnly()" /> </td>
<td width="20%" align="center"> <html:text property="clientSearchName" size="20" maxlength="20" onchange='<%= "SearchLength(this)" %>'/> </td>
<td width="30%"> </td>
</tr>
</table>
<table border="0" width="100%">
<tr>
<td width="30%"></td>
<td width="40%" align="center"><html:image property="findButton" src="images/Find.gif" alt="Find"/></td>
<td width="30%"> </td>
</tr>
<jsp:useBean id="selectEngForm" scope="session" class="Time.SelectEngForm" />
<% if (selectEngForm.getEngSearchNumber() != null) { %>
<tr>
<td width="30%"></td>
<td width="40%" align="center"><select name="engListing" size="5">
<%= selectEngForm.getEngListing() %>
</select></td>
<td width="30%"> </td>
</tr>
<% } else if (selectEngForm.getClientSearchName()!=null){ %>
<tr>
<td width="30%"></td>
<td width="40%" align="center"><select name="engListing" size="5">
<%= selectEngForm.getEngListing()%>
</select></td>
<td width="30%"> </td>
</tr>
<% } %>
<%=request.getParameter("engListing")%>
</table>
<br><br>
<table border="0" width="100%">
<tr>
<td width="30%"></td>
<td width="11%" align="center"> <html:image property="addButton" src="images/Add.gif" alt="Add the selected engagement to the timesheet"/> </td>
<td width="11%" align="center"> <html:image property="cancelButton" src="images/Cancel.gif" alt="Cancel"/> </td>
<td width="30%"> </td>
</tr>
</table>
</html:form>
</center>
<br>
<center><html:link forward="timesheet"> <html:img src="images/Back.gif" border="0"/> </html:link></center>
</body>
</html:html> -
URGENT !( jdbc query problem)
Hi Forum
i made an application which run on JRun server.
In many of my jsps i used sql query like this:
" select id, name, rollno from student where add = 'jj';"
and retrieve the record from resultset like this:
rs.getString("id");
rs.getString("name");
rs.getString("rollno");
I got no error.
BUT WHEN I RETRIEVE THE RECORDS LIKE THIS
rs.getString("name");
rs.getString("id");
rs.getString("rollno");
i got the error:
java.sql.SQLException: [Oracle][ODBC]Invalid column number <1>.
I can not understand what is the problem ?
all the datatypes are correct.
all coding is correct.
and everything is correct.
pls help me & suggest a solution.
is there any problem of jdbc API OR of JRUN SERVER SETTINGS?
thanks
mail me at [email protected]
Arvind GoelHere is a part of my code in which i got error:
(all variables are defined)
It is the working code. BUT when i change the sequence of retrieving fields as i select then problem occurs.
pls help me, i need it urgently.
if(st.equals("YES")){
rs=stmt.executeQuery("select r.na_WPN, m.MK_WPN, m.tp_WPN, m.REC_NO, m.ISSUED, r.dte_del, r.ps from amm_issue r,armentry m where r.ent_srno=m.srno and r.ps='"+username+"' and m.issued='YES' ");
else if(st.equals("NO")){
rs=stmt.executeQuery("select r.na_WPN, m.MK_WPN, m.tp_WPN, m.REC_NO, m.ISSUED, r.dte_del, r.ps from amm_issue r,armentry m where r.ent_srno=m.srno and r.ps='"+username+"' and m.issued='NO' ");
else if(st.equals("BOTH")){
rs=stmt.executeQuery("select r.na_WPN, m.MK_WPN, m.tp_WPN, m.REC_NO, m.ISSUED, r.dte_del, r.ps from amm_issue r,armentry m where r.ent_srno=m.srno and r.ps='"+username+"'");
while(rs.next())
String tp_wpn=rs.getString("na_WPN");
String mk_wpn=rs.getString("MK_WPN");
String no_wpn=rs.getString("tp_WPN");
String rec_no=rs.getString("REC_NO");
String issued=rs.getString("ISSUED");
dte_del =rs.getString("dte_del");
ps= rs.getString("ps");
if(i==0){
out.println("<tr><th>Police Station </th> <th>Type of Weapon</th><th>Make of Weapon</th><th>No of Weapon</th><th>Recipt No</th><th>Issued Status</th><th>Date of Receiving");
}i++;
out.println("<TR><td>"+ps+" <td>"+no_wpn+" <td>"+mk_wpn+"</td> <td>"+tp_wpn+"</td> <td> "+rec_no+"</td><td>"+issued+"<td><center>"+dte_del+" </td>");
thanx
Arvind -
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. -
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. -
URGENT: J2ME CDC on Linux/ARM7 platform..
Hi,
Is there a J2ME CDC available for Linux/ARM7 platform.
Its urgent.
thanks in advance,
RajYou can use JDK1.1.8 instead of CDC. Take a look here -> http://www.blackdown.org/java-linux/ports.html
-
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.
% -
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)
Maybe you are looking for
-
Does the apple thunderbolt to ethernet dongle support promiscuous mode ?
Does the apple thunderbolt to ethernet dongle support promiscuous mode ? I need to use the new Retina MBP as a professional laptop for work, and I need to use Etherreal. Etherreal needs the Ethernet card/dongle/chip to run in Promiscuous mode. I have
-
Two questions ... 1. I'm getting the following warning ... I think that a TIFF file bigger than 2 gb does not create any quality issue in LR - PS workflow ... correct? It is just related with some third party programs, as the warning box says. 2. Thi
-
How to know whether my ipad is under warranty
How to know whether my ipad 2 is under warranty
-
Hi, I want to do some experiments with JMF as an rtsp client. From the JMF docs i understand that all that is needed to create a player for an rtsp stream is calling the Manager.createPlayer method with an rtsp URL. So far so good but when i try to c
-
I receive my fax's electronically and when I get a legal size (8.5x14) fax Acrobat Reader 9 detects the paper size as letter size. Needless to say this causes my fax to be shrunk when I print. When I look at the properties of the fax it shows the pap