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,
Oliver
Oliver 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
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. -
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 -
How do I install the jdbc driver for sql server 2005, in sql developer 4.0 ?
Hallo together
I need access to tables in a MS SQL Server 2005 database.
One possibility is the JDBC driver.
How do i install this driver ?
Thank you very much for your postings.Hi,
This is from the documentation -
Database: Third Party JDBC Drivers
The Third Party JDBC Drivers pane specifies drivers to be used for connections to third-party (non-Oracle) databases, such as IBM DB2, MySQL, Microsoft SQL Server, or Sybase Adaptive Server. (You do not need to add a driver for connections to Microsoft Access databases.) To add a driver, click Add Entry and select the path for the driver:
For Microsoft SQL Server or Sybase Adaptive Server: jtds-1.2.jar, which is included in the jtds-1.2-dist.zip download
To find a specific third-party JDBC driver, see the appropriate website (for example, http://www.mysql.com for the MySQL Connector/J JDBC driver for MySQL, http://jtds.sourceforge.net/ for the jTDS driver for Microsoft SQL Server and Sybase Adaptive Server, or search at http://www.teradata.com/ for the JDBC driver for Teradata). For MySQL, use the MySQL 5.0 driver, not 5.1 or later, with SQL Developer release 1.5.
You must specify a third-party JDBC driver or install a driver using the Check for Updates feature before you can create a database connection to a third-party database of that associated type. (See the tabs for creating connections to third-party databases in the Create/Edit/Select Database Connection dialog box.)
Alternative:
As an alternative to using this preference, you can click Help, then Check for Updates to install the JTDS JDBC Driver for Microsoft SQL Server and the MySQL JDBE Driver as extensions.
Regards,
Mike -
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 -
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.
% -
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. -
BLOB support in standard postgresql jdbc driver - OutOfMemoryError
Hi all,
I have a problem with PostgreSQL and BLOBs.
Small BLOBs work, but with BLOBs of a certain size my code throws a java.lang.OutOfMemoryError.
The file I tried has about 2-3 MB.
Environment:
- PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.96
- Mandrake 8.2
- 192 MB RAM
- blob column created as datatype "bytea" (maybe that is the problem)
- code posted below (BlobPostgresTest.java)
- console output posted below
- java command to run program:
java -verbose:gc -Xmx128m -classpath .:pgjdbc2.jar BlobPostgresTest- java version as follows from "java -version" command:
java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)do you have an idea how to solve this problem ?
Console output (including GC activities):
=========================================
java -verbose:gc -Xmx128m -classpath .:pgjdbc2.jar BlobPostgresTest
BLOB/PostgreSQL Demo started
[GC 511K->230K(1984K), 0.0163708 secs]
preparing statement
setting binary stream
[GC 402K->273K(1984K), 0.0092325 secs]
[Full GC 273K->273K(1984K), 0.0771294 secs]
[GC 4351K->4058K(4908K), 0.0046329 secs]
[Full GC 4058K->3770K(4908K), 0.0831070 secs]
[GC 4922K->4922K(6860K), 0.0009556 secs]
[Full GC 4922K->4346K(6860K), 0.0890570 secs]
[GC 6650K->6650K(7820K), 0.0011110 secs]
[Full GC 6650K->5496K(7820K), 0.1420860 secs]
[GC 10104K->10104K(14480K), 0.0012827 secs]
[Full GC 10104K->7800K(14480K), 0.1236744 secs]
[GC 17016K->17016K(24084K), 0.0015421 secs]
[Full GC 17016K->12408K(24084K), 0.1688843 secs]
[GC 30840K->30840K(43224K), 0.0020800 secs]
[Full GC 30840K->21624K(43224K), 0.2547274 secs]
[GC 76920K->74616K(81500K), 0.0041685 secs]
[Full GC 74616K->49272K(81500K), 0.5688448 secs]
[GC 67704K->67704K(88332K), 0.0033407 secs]
[Full GC 67704K->58488K(88332K), 0.2558231 secs]
executing update
[GC 95352K->95352K(104844K), 0.0932741 secs]
[Full GC 95352K->40056K(104844K), 0.9644251 secs]
[GC 69245K->69245K(104844K), 0.0036631 secs]
[Full GC 69245K->69245K(104844K), 0.0814962 secs]
[Full GC 69245K->66324K(129728K), 1.1439123 secs]
Exception in thread "main" java.lang.OutOfMemoryError
BlobPostgresTest.java
=====================
import java.sql.*;
import java.io.*;
drop table blobdemo;
drop sequence blobdemo_id_seq;
create table blobdemo(
id serial not null primary key,
name varchar(50),
content bytea);
public final class BlobPostgresTest {
private final static String NAME = "TEST";
//private final static String FILE_NAME = "/tmp/blob/2mb.xxx";
private final static String FILE_NAME = "BlobPostgresTest.java";
public final static void main(String[] args) throws Throwable {
Connection con = null;
Statement statement = null;
PreparedStatement insertStatement = null;
ResultSet rs = null;
File file = null;
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
System.out.println("BLOB/PostgreSQL Demo started");
Class.forName("org.postgresql.Driver");
con = DriverManager.getConnection
("jdbc:postgresql://localhost/template1",
"postgres", "");
con.setAutoCommit(true);
statement = con.createStatement();
// cleanup
statement.executeUpdate("delete from blobdemo");
// file
file = new File(FILE_NAME);
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
// insert one record
System.out.println("preparing statement");
insertStatement = con.prepareStatement
("insert into blobdemo ( name, content ) values ( ?, ? )");
insertStatement.setString(1, NAME);
System.out.println("setting binary stream");
insertStatement.setBinaryStream(2, bis, (int)file.length());
System.out.println("executing update");
insertStatement.executeUpdate();
// retrieve
rs = statement.executeQuery
("select id, name, content from blobdemo");
while(rs.next()) {
System.out.println("id=" + rs.getObject(1));
System.out.println("name=" + rs.getObject(2));
byte[] bytes = rs.getBytes(3);
String content = new String(bytes);
//System.out.println(content);
System.out.println("retrieved " + bytes.length + " bytes");
} finally {
if(rs != null) rs.close();
if(statement != null) statement.close();
if(insertStatement != null) insertStatement.close();
if(con != null) con.close();
if(fis != null) fis.close();
if(bis != null) bis.close();
System.out.println("BLOB/PostgreSQL Demo complete");
}FYI: I'm in contact with the postgres team to work on the problem. it is caused by the way blobs are implemented in the jdbc driver.
http://archives.postgresql.org/pgsql-jdbc/2002-08/msg00096.php -
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. -
Hi
i install websphere 5 and try to connect to my sql server but cannot find jdbc driver class path and can not find any jdbc driver
pls tell me how can i install jdbc driver in my websphere
with regardsYou may get a better response posting this question in a WebSphere specific forum. Maybe this will help, the following link shows the command you need to execute to install a JDBC driver in websphere 5.0.
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?tab=search&searchWord=mysql+driver&maxHits=50 -
Difficulty Installing the MySQL JDBC Driver
I am trying to install mySQL JDBC driver "mysql-connector-java-2.0.14.tar.gz" to link up with the mySQL server on a Windows XP OS.
The error is:
Cannot find database driver classes
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
I have read the USAGE AND INSTALLATION in the README file, but it can not seem to find these drivers still. I added the location to my PATH variable in the environment variables, and set CLASSPATH= ... as well and still can not find them
Paths i added to PATH and CLASSPATH variables
C:\j2sdk1.4.0_01\mysqlconnector.tar
C:\j2sdk1.4.0_01\JDBC
I did both methods it suggested, within the JDBC folder are the com and org folders. Anyone offer some suggestions.
I know some smart person is going to say just use linux, but it is needed for my father and he can barely use MS Windows.
Cheers for any helpDear Java Newsgroup User
I would like to understand more around the Java and MySQLJDBC Configuration. Because I have some problem trying to install and Testing the MySQL JDBC Connector Driver.
I use Windows XP Professional.
I Downloaded and Intalled Sun One Studio to start learning JAVA and Features. This SDK Package make 3 Packages (directories):
Directory No1 C:\JSDK4\j2sdk1.4.1_02 (JAVA_HOME)
Directory No2 C:\JSDK4\s1studio (Source Examples ...)
Directory No3 C:\Archivos de programa\Java\j2re1.4.1_02 (Java R. Env.)
In the WINDOWS XP PANNEL CONTROL apper Java Plugins Control Pannel also
when I press or click this icon apper a Java Screen where i can see the following Configuration in the Advanced Option:
Java RuntTime Enviroment:
Use Java Plugin Default
JRE 1.4.1_02 in C:\Archivos de programa\Java\j2re1.4.1_02
SDK 1.4.1_02 in C:\JSDK4\j2sdk1.4.1_02
MySQL Driver Confiration and Version:
This is my Un-ziped MySQL JDBC connector Path:
C:\JSDK4\j2sdk1.4.1_02\mysql-connector-java-3.0.8-stable
Into mysql-connector-java-3.0.8-stable directory exist an directory called [testsuite] that have some jar, java and class files.
Testing MySQL JDBC Connecto Driver and Error Message:
When i try to run the BaseTestCase.class file the system give me the following ERROR Message:
C:\JSDK4\j2sdk1.4.1_02\mysql-connector-java-3.0.8-stable\testsuite>java BaseTestCase
Exception in thread "main" java.lang.NoClassDefFoundError: BaseTestCase (
ame: testsuite/BaseTestCase)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
My Question are the following:
1- What is the meaning of this message error?
2- What i need to do to solve this problem?
3- What is the function specificly of the JRE 1.4.1_02 in C:\Archivos de programa\Java\j2re1.4.1_02 Directory in My JAVA Instalation.
I you need more detail of my instalation please write me and i write back a soon as possible.
Dear Users:
Please Help Me! to continue with the next steps ...
Best Regards and Than's so much for read this message
From Panama City
VanyRon -
Oracle JDBC driver 10.1.0.2.0
Hi All,
I have installed Oracle 9iR2 on Windows 2000 Advance server, and i am looking for Oracle JDBC driver 10.1.0.2.0 to be installed and configured, it would be real help if some one could send me the download path and how to continue further with installing the JDBC driver
Thanks,
KumarYou can download the latest JDBC drivers from http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
You just need to place the jar somewhere and add the location to your classpath.
Kuassi -
Test JDBC Driver For SQL Server 2000 Failed
Hi:
I have trouble setting up the database connection using jdbc driver in the studio, could anyone help me please? I have MS SQL 2000 MSDE installed on my local machine. I downloaded and installed the JDBC Driver for MSSQL 2000 from Microsoft.
I put the following jar files into the/lib/ext/ directory
msbase.jar
mssqlserver.jar
msutil.jar
In Studio 4.1 EE, I went to Runtime>Databases>Drivers, Add a new Driver with these information:
Name: MSSQL Driver
Driver: com.microsoft.jdbcx.sqlserver.SQLServerDataSource
URL Prefix: jdbc:microsoft:sqlserver://localhost:<PORT>[;DatabaseName=<DB>]
Next I run the Test Driver...
Database URL: jdbc:microsoft:sqlserver://<machineName>\\<instanceName>;DatabaseName=<xxx>
User: <username>
Password: <password>
I receieved the a popup box and message in the output window:
Internal test driver incomplete. the driver may not support the required DatabaseMetadata methods. take a look at the Output Window for details.
Warning: No tables were found. Check your database.
Warning: No views were found. Check your database
Warning: No procedures were found. Check your database.
Your replies are greatly appreciated.
Perrycom.microsoft.jdbcx.sqlserver.SQLServerDataSource is a very old direct driver. I'd recommend using the DataDirect 3.2 driver. It can be found at:
http://www.datadirect-technologies.com/products/jdbc/jdbcindex.asp -
Hi,
I am writing a Java Swing application on Suse Linux and want to add Embedded SQL to it. The application should interact with a PostgreSQL database running on my local machine. The compiler complains that it cannot find the org.postgresql package included in the code. I'm guessing the problem is that the classpath is not set properly. But when I try to add the postgresql-jdbc driver to the classpath using "export CLASSPATH=$CLASSPATH:/usr/share/pgsql/pg73b1jdbc1.jar", the program stops recognizing the other Java files it uses. How do I set the classpath up properly?
Code sample:
import java.awt.*;
import javax.swing*;
import java.sql.*;
import org.postgresql.*;
public class MyClass
public static void main (String [] args)
MyFrame frame = new MyFrame();
MyPanel panel = new MyPanel();
// more code here
MyClass.java:4: package org.postgresql does not exist
import org.postgresql.*;
^
1 error
Any help is much appreciated.
Marina.Hi, I figured it out - thanks to JimDinosaur's response, although to a different thread. I am posting a reply in case other people had the same question.
So, I had two problems: first, the package wasn't recognized; second, the rest of the Java files used by the code.
Jim suggested to use javac -classpath, listing all the directories needed, for the packages and the files. So I did, with the files directory being my current directory:
javac -classpath /usr/share/pgsql/pg73b1jdbc1.jar:. CloningGUI.java
Jim, you rock! :) -
Hi,
I'm a newbie and just started programming in java. I dont know if this message is to be posted here or somewhere else. This is my first post. So please tolerate..
I use Fedora Core 4. I installed the JDBC driver (mysql-connector-java-3.1.12) for the mysql database as specified in the instructions. I copied the mysql-connector-java-3.1.12-bin.jar file to /root/jdk_nb/j2sdk1.4.2/jre/lib/ext and set the CLASSPATH environment variable in .bashrc as follows
export CLASSPATH=${PATH}:/root/jdk_nb/j2sdk1.4.2/jre/lib/ext
I also run the .bashrc file.
THen i executed a small program to get the names of the drivers loaded.
import java.sql.*;
import java.util.*;
class listJdbcDrivers
public static void main(String args[])
List drivers = Collections.list(DriverManager.getDrivers());
for (int i=0; i<drivers.size(); i++)
Driver driver = (Driver)drivers.get(i);
// Get name of driver
String name = driver.getClass().getName();
System.out.println(name);
// Get version info
int majorVersion = driver.getMajorVersion();
int minorVersion = driver.getMinorVersion();
boolean isJdbcCompliant = driver.jdbcCompliant();
System.out.println("Major Version"+majorVersion);
System.out.println("isJdbcCompliant"+isJdbcCompliant);
Then i did a javac listJdbcDrivers.. It compiled
Then i did a java -Djdbc.drivers=mysql-connector-java-3.1.12 listJdbcDrivers..
But it does not print out any drivers. Why is this happening?That's a lot of chutzpah. No, I will not do your work for you.
DriverManager#registerDriver() adds a driver and registers it. I believe after you do this, getDrivers() would return that driver.
I also mentioned for completeness that instantiating a driver (via newIntance() on a class or via its constructor) normally results in that driver registering itself via DriverManager#registerDriver().
- Saish
Maybe you are looking for
-
Time Machine is (kind of) stuck...
Time Machine has been working more or less flawlessly for me up until a few days ago. I have my Time Machine backup on an external USB drive and I am running my Mac on a Standard account. Now, every time it is backing up, it is stuck at a certain per
-
How do i log in on a macbook air with out wifi for the first time
How do i log in on a macbook air with out wifi for the first time
-
Connection timed out: connect for ebMs messages
Hi We are facing a problem while posting an outbound message in ebMS. We encounter the following error. Machine Info: (INBAAMPC00933) *Transport error: [IPT_HttpSendConnectionRefused] HTTP connection is refused.* Connection refused: connect Oracle b2
-
Will a bluetooth adapter work with AirPort
Hey Ladies and Gents, If I were to buy a bluetooth adapter for an iPod Classic, will it communicate with an AirPort system? My main goal is to send music to my home stereo from my iPod wirelessly. Is this possible? Thanks for you help, Jason
-
Garageband won't start after updating to iLife 06
Hi I've just updated to GB with iLife 06 and now GB won't open. It displays an initiallising box and then hangs and I have to force quit. I normally use Logic Pro for audio but wanted to use GB for pdcasting etc. Mac OS X (10.4.4) Logic Pro 7.2 G