Installing a JDBC-driver in the classpath in win 2000
Hi
I'm trying to make an aplication, that can access a remote DataBase, with the mm.mysql driver.
I have tryed to add the path to the libery where the jar file is in the classpath (in win 2000). But I can't get it to work from a dos-promt.
put it in your enviroment.
Control Panel -> System -> Enviroment.
Similar Messages
-
How to install a JDBC driver?
Hello, everybody!
I'm new to Java and I'm trying to install a JDBC driver. So, I downloaded the JayBird,
a JDBC driver for Firebird, and now I don't know how to install the driver. I keep
getting this message from the compiler when I try to compile the example that comes
with the driver:
DriverExample.java:182: package org.firebirdsql.jdbc does not exist
d = new org.firebirdsql.jdbc.FBDriver ();
^
1 error
So, in the directory that has the example file (DriverExample.java) I created the
following directory structure:
C:\Example\org\firebirdsql\jdbc
and inside the jdbc directory I copied the driver files:
firebirdsql.jar
mini-concurrent.jar
jaas.jar
mini-j2ee.jar
log4j-core.jar
and I still keep getting the error from the compiler. I just would like to
know what I have to do to install this driver correctly for the compiler to
find its packages.
Below are the instructions the comes with the help to install JayBird, but I
think that I did everything and it still didn't work:
======================================================================
The classes from firebirdsql.jar must be in the classpath of the Java
application being compiled, or otherwise made available to your application.
The classes from the following packages must also be available:
mini-concurrent.jar
jaas.jar (included in jdk 1.4)
mini-j2ee.jar (now including JDBC classes)
log4j-core.jar (if you want logging available)
The firebirdsql-full.jar file has all of the needed files in one
archive for ease of use.
These archives are included in the binary package.
======================================================================
Please can someone help me?
Thank you...
MarcosMy file (DriverExample.java) is in the directory 'Example' and the driver files are in the directory 'Example\org\firebirdsql\jdbc'
That's what I did inside the directory 'Example'
javac -classpath org/firebirdsql/jdbc/firebirdsql.jar DriverExample.java
And that compiled ok.
Now how can I specify where the driver files are for the java.exe? Of course I tried:
java DriverExample
and it didn't work. -
How can i load microsoft SQL Server driver in the classpath ?
Hi
i need to have microsoft SQL Server driver in the classpath , how can i do that to run the following code :
String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
Class.forName(driver);
with best regardsJust as information, if you need to load a JDBC driver dynamically without previously knowing its name (meaning you can't add it to the classpath manually in your startup batch), the following will not work:
// register the SQL driver as necessary
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
// connect to the DB by using the driver.
String connString = "my_dbserver:1433;databasename=my_database";
String strDBConnect = "jdbc:microsoft:sqlserver://" + connString;
conn = DriverManager.getConnection(strDBConnect, userName, passwd);
This is because the DriverManager.getConnection checks if the loaded class was loaded by the same class loader than itself. And for dynamic scenarios, you need a new classloader for the new classes.
Above, the class will be loaded correctly, but getConnection will fail.
This behaviour costed me several hours while developing a dialog for adding drivers dynamically, until I saw the reason.
But a solution has been posted in the forums, which goes like this:
// jdbcLoader is my individual class loader, you can construct it with the driver url
Class driverClass = Class.forName(driverName, true, jdbcLoader);
currDriver = (Driver)driverClass.newInstance();
// problem: classes which were loaded in custom class loader are not recognized by DriverManager. So the following would fail:
// conn = DriverManager.getConnection(...)
Properties prop = new Properties();
prop.setProperty("user", (String)paras.get("youruser");
prop.setProperty("password", (String)paras.get("yourpwd");
conn = currDriver.connect((String)paras.get("yourURL", prop); // this one works for all classloaders
But in your case, it seems to be enough to add the file manually, as was described in previous replies...
Regards,
Christian Sy -
Which jdbc driver should be used for sqlserver 2000 and where to put it.
hi all,
My odi is 11g. I met the error infor "Could not load JDBC driver class [com.microsoft.sqlserver.jdbc.SQLServerDriver]" when i tried to connect to a sqlserver2000 database.
The questions are:
1. which jdbc driver should be used for sqlserver 2000?
2. which folder to put it in?
3. how to set the physical topological "Microsoft Sql Server" to use this jdbc driver?
failed tries:
i downloaded the driver "SQL Server 2000 Driver for JDBC Service Pack 2" and put it in the following folders:
1. .../oracledi/drivers, and set this path to CLASSPATH.
2. .../oracledi/userlib didn't exist, i created it and put the driver in.
3. .../oracledi/agent/dirvers, in which a readme file exists and told me to put drivers in this folder.
All these works were not useful. when I start odi.sh and try to connect to sqlserver2000 database, the same error infor came up.
my environment is:
os: Linux 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
java: Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)
ODI: 11g, installed in /users/oracle/odi/
please help me,thanks a lot.
jun
帖子经 Jun编辑过Hi,
You should check which JVM version is required by that version of the driver, I think the 2.x versions require a 1.6 JVM
What error are you getting? If it is the "com.sunopsis.sql.c: No suitable driver", it indicates it can't find the jar file (sqljdbc.jar) for the driver you specify.
Drivers folder in ODI 11g is under
C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\agent\drivers.
if you are using the standolone version
On windwos :
C:\Documents and Settings\<userName>\Application Data\odi\oracledi\userlib
on linux
$HOME/.odi/oracledi/userlib
Have a read of :- http://download.oracle.com/docs/cd/E14571_01/core.1111/e16453/install.htm#CHDBIFAJ
Thanks,
Sutirtha -
Does wls8.1 install with oracle jdbc drivers in the classpath by default?
I just went through the 8.1 install tonight and it looks to me like the
oracle jars are in the default weblogic classpath.
set
WEBLOGIC_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_s
p.jar;%WL_HOME%\server\lib\weblogic.jar;%WL_HOME%\server\lib\ojdbc14.jar
Why is that? I don't have oracle, and with just learning how to use wls, it
took me a bit of time to finally figure this piece out (trying to get MySQL
drivers loaded). Not everyone has Oracle installed, so why put it on the
classpath for all servers/domains when they startup?
Thanks.I'm not sure what the best practice is.
The Oracle driver is set in
bea/weblogic81/common/commEnv.cmd or commEnv.sh.
There is a WEBLOGIC_CLASSPATH that has the jars in it and I always
put my stuff at the beginning.
I suspect that the preferred way of doing this is to update
/bea/weblogic81/samples/domains/examples/startExamplesServer.cmd
or whatever script is used to start the server.
"Flip" <[remove][email protected]> wrote in message news:[email protected]...
Hey Stephen, thanks for the reply.
You got it to work without probs? COOL! :> Where did you stick the driver
and where did you put the jar reference (in which cmd/sh file and where
abouts in the file)? Inquiring minds want to know! :>>>> I tried looking
on the web, but I was referenced to some PRE_CLASSPATH params, as well, as
putting it into my own directories... I'm just looking to find out what dir
is the best practise to dump the jar file into and where to put the
reference in a classpath.
One small note, I do dev in WIN and run production on linux (that might
change soon, but that's another question, and another server :>).
Thanks.
PS BEA, nice domain config wizard with 8.1! Very sweet, I like the
integrated connection pool and datasource creation!
"Stephen Felts" <[email protected]> wrote in message
news:[email protected]...
The Oracle driver (client jar) is shipped in the box. Having it in theCLASSPATH makes it easier
for customers that use it.
If you don't use it and you want to use another driver, it won't get inthe way
since your alternate driver will have a different classname.
I installed and ran MySQL with no problems.
"Flip" <[email protected]> wrote in message
news:[email protected]...
I just went through the 8.1 install tonight and it looks to me like the
oracle jars are in the default weblogic classpath.
set
WEBLOGIC_CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\weblogic_s
p.jar;%WL_HOME%\server\lib\weblogic.jar;%WL_HOME%\server\lib\ojdbc14.jar
Why is that? I don't have oracle, and with just learning how to usewls, it
took me a bit of time to finally figure this piece out (trying to getMySQL
drivers loaded). Not everyone has Oracle installed, so why put it onthe
classpath for all servers/domains when they startup?
Thanks. -
How to install jTDS jdbc driver
I've heard so much about this jTDS driver, and had it with the current jdbc driver i'm using. I'm using slserver 7. i would like to install the jtds driver. I just downloaded the .jar file. how do i install the driver. which directory do i put it in? pls help asap. thanks a million.
"Install" it?
The directory you put it in depends greatly on the application that's using it.
If it's a desktop app, put in in the CLASSPATH for the app.
If it's a Web app, put it in the WEB-INF/lib directory for your app.
It's not a cut & dried answer. I don't think one JAR file will necessarily serve all apps. Expect to have duplicates as needed. I do.
% -
Installing Postgresql JDBC Driver WLS 8.1
Hi,
Can somebody explain how I install the JDBC Driver for postgresql? I have WLS
8.1.2 on Win XP. I think the solution would be to set the CLASSPATH to the appropriate
location. But how do I do this permanently?
Thanks,
OliverOliver wrote:
Hi,
Can somebody explain how I install the JDBC Driver for postgresql? I have WLS
8.1.2 on Win XP. I think the solution would be to set the CLASSPATH to the appropriate
location. But how do I do this permanently?
Thanks,
OliverHi. Read the startWeblogic script to see how it constructs the -classpath argument for
the weblogic JVM. You can either add the postgres classes to an environment variable
PRE_CLASSPATH, or edit the startup script etc.
Joe -
I have installed MySQL and downloaded the JDBC driver.
What is the proper way to install this driver on a weblogic application server 8.1?
Placing it in the server\lib or portal\lib didn't work.
I 've managed add it to the classpath in my domain's startWebLogic bat script, but that doesn't seem a clean way.Howdy.
re doesn't seem like a clean way
I agree, but I think that's the way to do it. Someone else I'm sure will
correct me/you if we're wrong.
One alternative is to use the pre classpath and/or post classpath env vars.
Or something else, add a classes dir to your domain, and add that classes
path. It's a bit more visually understood where the third party jars are
located in that case.
"Geoffrey" <[email protected]> wrote in message
news:3f6ad58c$[email protected]..
I have installed MySQL and downloaded the JDBC driver.
What is the proper way to install this driver on a weblogic applicationserver 8.1?
>
Placing it in the server\lib or portal\lib didn't work.
I 've managed add it to the classpath in my domain's startWebLogic batscript, but that doesn't seem a clean way. -
Help installing new JDBC driver on LINUX
Hello,
Today, I downloaded the new SQL Server 2005 JDBC Driver onto
my Linux Server. The path to the driver's .jar file is
/root/sqljdbc_1.0/enu/sqljdbc.jar. I placed that path in my CF
Adminstrator "Java and JVM" page's Class Path field. I restarted
the app server but each time I try to establish a dsn connection I
keep getting this error. (note: I have dsn's set up already to this
instance of SQL Server 2005 so the communicatio is there but I
would prefer to use this new driver)
Connection verification failed for data source: dsnTestDB
java.sql.SQLException: No suitable driver available for
dsnTestDB, please check the driver setting in resources file,
error: null
The root cause was that: java.sql.SQLException: No suitable
driver available for dsnTestDB please check the driver setting in
resources file, error: null
Any help would be greatly appreciated.
Thanks,
mdg1
Houston, TXTry placing the jar file in the
{cfmx-root}/runtime/servers/lib (create if not already there)
directory if you have the server install or the
{jrun-root}/servers/lib directory if you have the multiserver or
j2ee install on JRun. Restart the Coldfusion applicatioin server.
Ted Zimmerman -
SQLDeveloper 3.1 EA3 -- error installing JTDS JDBC Driver for Microsoft SQL
After installing sqldeveloper64-3.1.06.82-no-jre.zip I get an error when trying to add the "JTDS JDBC Driver for Microsoft SQL Server" extension.
The error returned is an invalid URL.
The URL is http://download-llnw.oracle.com/otn-pub/sqldeveloper/oracle.sqldeveloper.thirdparty.drivers.sqlserver.58.17.zipHi Chris,
A bug was logged for this a few days ago:
Bug 13547400 - CHECK UPDATES FAILS DUE TO SERVER RETURNED HTTP RESPONSE CODE: 400
This is similar to another bug which has already been fixed (not a product bug, just a bad URL in an OTN web page):
Bug 13530787 - 3.1 EA2: FORUM: CHECK FOR UPDATE HAS BAD URL FOR CVS
3.1EA2 Sqldeveloper Updates Fail to install
So I imagine yours will get fixed soon.
Regards,
Gary
SQL Developer Team -
I have installed my LaserJet 100 color MFP M175nw on my (32-bit) Windows XP Pro SP3 PC via USB and it works fine. When I make it the default printer (I also have another HP printer installed locally) and use Windows Remote Desktop (RDP) to my server - which is (64-bit) Windows Enterprise without Hyper-V SP2 (2008 R2) it prints but some fonts show gobbledygook. The printer driver on the server is defaulting to "terminal services easy print". I have administrator privileges on the server and have, in the past, been able to download the appropriate driver to the server so that printing in the RDP session works. But now I only seem to be able to find installation software to download (not the actual drivers). So, when attempting to install the software (rather than copy it) on the server the installation waits for the local (USB) connection and won't proceed.
What is the best practices way to have the locally installed (fully functional) machine be able to print from an RDP session? I'm sure I shouldn't have to drag each new local printer to the server and install it locally with a USB cable.Hi there IT _Mgr
Quick suggestion; This is a commercial product. I will suggest seraching for posible solutions and posting in the forum for HP Business Support for yet a better chance at finding a prompt solution.
You may find the commercial Laserjet board here.
http://h30499.www3.hp.com/t5/Printers-LaserJet/bd-p/bsc-413
Hope you find the help you need there;
RobertoR
You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance! -
How do I install a printer driver, without the printer?
You see, I don't want to print anything.
I am using some CAD software and I use the “create PDF” function of the printer dialogue to make a PDF. The problem is my drawing is quite large so I need to install a printer driver for a printer that handles larger paper (Epson 1280). I have the driver, but it refuses to install without the printer being attached to it.I didn't post one.
-
Installing second optical drive and the door hangs
This is just an FYI post, have not been able to find anyone else with the exact same problem, but thought I would list in the event of.
I originally installed an internal DVD R/RW Lightscribe drive from LaCie in a Power Mac G4 Dual 1Gig and it worked well! I have since purchased a MacPro and wanted to move the Lightscribe drive into the second optical drive bay. So after installing the drive and attempting to open the tray it was apparent that the door on the case would not allow the tray to open. The front of the Lightscribe tray was too bulky to fit through the opening on the narrower Mac Pro optical drive door.
Well, the folks at Lacie had attached a nameplate to the front of the tray that works fine in other configurations, but on the MacPro the clearance for the tray is narrower and it's bulk would not activate the sliding door properly.
Someone was thinking, because the tray nameplate is detachable with a little effort. I can provide photos if need be.
Tray closes as it should now.Hi TCherry,
Your situation interests me since I was thinking of doing the same with a previous optical drive from an old G4. I also wanted to add it to my MacPro's 2nd slot.
Are you still willing to supply some pics to see what you did?
Rio. -
Mm.mysql JDBC Driver and the WHERE clause
Anybody has succesfully performed a MySQL/JDBC query in a JSP application using more than one variable in the WHERE clause?
It works fine when I run queries with one fixed value assigned to a column and one variable assigned to the other column in the WHERE clause; but when I do it with more than one variable in the WHERE clause, it screws up throwing an error.
I wonder if it is a code error, a syntax error or if it is something tricky about the mm.mysql JDBC Driver. Following is a section of the code and the error. The variables are s_description and s_status. I read some examples in a book but they use SQL Server. Thank you in advance for any information.
CODE:
<% String sqlStatement = "" ; %>
<% String s_description = "Mexican Style Rice" ; %>
<% String s_status = "available" ; %>
<% java.sql.Statement stmt = con.createStatement(java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, java.sql.ResultSet.CONCUR_UPDATABLE); %>
<% java.sql.ResultSet rs ; %>
<% sqlStatement = "SELECT code, description, status FROM products WHERE products.description =" + s_description + " AND products.status =" + s_status + ";" ;%>
<% rs = stmt.executeQuery(sqlStatement); %>
<% rs.beforeFirst(); %>
<% while (rs.next()) { %>
<% rs.updateString(3, "sold"); %>
<% rs.updateRow(); %>
<% }%>
<% rs.close(); %>
This is the ERROR it throws
java.sql.SQLException: Column not found: Unknown column 'available' in 'where clause'
at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)
at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
at org.gjt.mm.mysql.Statement.executeQuery(Statement.java:169)
at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78)
at pagecompile._GetFood_xjsp._jspService(_GetFood_xjsp.java:45)
at com.newatlanta.servletexec.JSP10HttpJspPage.service(JSP10HttpJspPage.java:41)
at com.newatlanta.servletexec.JSP10Servlet.service(JSP10Servlet.java:779)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1679)
at com.newatlanta.servletexec.ServletExec.processServletRequest(ServletExec.java:1654)
at com.newatlanta.servletexec.ServletExec.processServletAlias(ServletExec.java:1602)
at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1343)
at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1113)I think perhaps this sentence has problems:
<% sqlStatement = "SELECT code, description, status FROM products WHERE products.description =" + s_description + " AND products.status =" + s_status + ";" ;%>
You can
<% sqlStatement = "SELECT code, description, status FROM products WHERE products.description ='" + s_description + "' AND products.status = '" + s_status + "'" ;%>
You perhaps ignore the ���� when using String variable s_description and s_status.
Hope this will help you. Good lucky! -
How to add JDBC Driver to my CLASSPATH
Hi~
I use MySQL JDBC Driver in my program like that
Class.forName("com.mysql.jdbc.Driver");But when I try to run it, I got a ClassNoFound Exception,I hava add mysql-connector-java-5.0.3-bin.jar into my CLASSPATH, but it no use.How to fix it ?
Thanks for your time~ ^_^Here's my code, Thank you very much. But I suggest that,you'd better write your own code to test it. Hehe,thanks~~
import java.sql.*;
import java.util.*;
import java.io.*;
public class DBTest {
private static Connection getConnection(String url, String username, String password)
throws SQLException, IOException{
try{
Class.forName("com.mysql.jdbc.Driver");
}catch(ClassNotFoundException e){
e.printStackTrace();
return DriverManager.getConnection(url, username, password);
private static void runTest(){
Scanner stdin = new Scanner(System.in);
String serverUrl, username, password;
serverUrl = "jdbc:mysql://localhost:3306/test";;
username = stdin.nextLine();
password = stdin.nextLine();
Connection conn =null;
try{
conn = getConnection(serverUrl, username, password);
}catch(SQLException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}finally{
try{
Statement stat;
if(conn != null){
stat = conn.createStatement();
stat.executeUpdate("CREATE TABLE Greetings (Message VARCHAR(20))");
stat.executeUpdate("INSERT INTO Greetings VALUES('Hello mysql')");
ResultSet result = stat.executeQuery("SELECT * FROM Greetings");
result.next();
System.out.println(result.getString(1));
// stat.executeUpdate("DROP TABLE Greetings");
}catch(SQLException e){
e.printStackTrace();
}finally{
try{
if(conn != null)
conn.close();
}catch(SQLException e){
e.printStackTrace();
public static void main(String args[]){
runTest();
}
Maybe you are looking for
-
How can I demo my mobile app on a web page? or standalone
Is there a way to show my Flex mobile app in a browser? either on a web page or standalone is ok. I'm using Flash Builder 4.6 to build a mobile app for iOs (iphone 4) and when I debug it, it shows the program in a window like the phone, Is there a w
-
i bought a iphone from my freind and its disabled and i have tried to restore it but when i do i tells me i need a update, and when i do this it tells me i need to wait 6 hours for the update and i just need to restore the iphone. i need help
-
Acrobat 9.0 product download link
I have a license for Acrobat 9.0 Pro Arabic Version Win Full, and I need the product download link?
-
Problem changing sld data supplier slddsuser to new userid in VA
We are experiencing lockouts with slddsuser in the SLD so I planned to change all fo the userid's under sld data suppliers to a unique userid for each client. I created a copy of user slddsuser in solution manager and made sure in the UME the new us
-
Why we need externalizable interface in java
Hi friends, I know the Concept of serliazation and externalization, apart from this concept i have one doubt about externalization, I feel both are doing same work. Then what is the nedd of externalizable interface. Can anyone tell what is the differ