Re: PB: JDBC Connection

From: Alfonso brugnoli <alfonso.brugnoli_at_tin.it>
Date: Wed, 24 Jan 2001 20:38:09 GMT
Message-ID: <R2Hb6.34622$lV5.491180_at_twister1.tin.it>


Thanks DriftWood ! I am Paolo Brugnoli and your message it's the very best quality.

I solved the problem with "jdbc:Polite:POlite", "SYSTEM", "My-password" but I do not used the driver oracle.pol.poljdbc.POLJDBCDriver It do not see ! I used the driver :
sun.jdbc.odbc.JdbcOdbcDriver

cheers

        Paolo Brugnoli

"DriftWood" <drift_wood_at_my-deja.com> ha scritto nel messaggio news:94i53q$6c0$1_at_nnrp1.deja.com...
> Try using the OLite JDBC driver rather than the ODBC bridge:
>
> import java.sql.*;
>
> public class JDBCEX {
> /**
> * Constructor.
> */
> public void JDBCEX () {
> }
>
> public static void main(String args[]) {
>
> Connection conn = null;
> Statement stmt = null;
> ResultSet retset = null;
>
> try {
> Class.forName("oracle.pol.poljdbc.POLJDBCDriver");
> conn = DriverManager.getConnection
> ("jdbc:Polite:POlite", "SYSTEM", "My-password");
> }
> catch (Exception e) {
> System.out.println("An error has occurred.");
> System.out.println("Please check your CLASSPATH variable and
> make sure that the database is not encrypted");
> System.out.println(e);
> System.exit(0);
> }
> /* create a statment */
> try {
> stmt = conn.createStatement();
> }
> catch (SQLException e)
> {
> System.out.println("conn.createStatement failed: " + e
> + "\n");
> System.exit(0);
> }
> /* retrive data from database */
> try {
> System.out.println(" \n------------ PRODUCT table ------
> \n");
> retset = stmt.executeQuery("SELECT * FROM PRODUCT");
> while(retset.next()) {
> int getValueInt = retset.getInt(1);
> String getValueStr1 = retset.getString(2);
> String getValueStr2 = retset.getString(3);
> System.out.println("\t\t" + getValueInt +
> "\t\t" + getValueStr1 +
> "\t\t" + getValueStr2 + "\n");
> }
 

> }
> catch (SQLException e) {
> System.out.println("Error occurred...");
> while(e != null) {
> System.out.println(e.getMessage());
> e = e.getNextException();
> }
> }
  }
> }
>
>
>
> --
> -cheers
> DW
> --------------------------------------------------------------------
> "It is a kind of good deed to say well; and yet words are not deeds.
> -William Shakespeare"
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Wed Jan 24 2001 - 21:38:09 CET

Original text of this message