JDBC Driver problem 
Author Message
 JDBC Driver problem

I wrote 2 simple applets that use jdbc to query on an Access database.
Everything is working well when I view them with a browser, but only when I
do that in 2 DIFFERENT sessions (I have to close and re-open netscape)! When
I try to open them on 2 pages, or one after the other, I get this error
message:

java.sql.SQLException: No suitable driver
  at java.sql.DriverManager.getConnection(DriverManager.java:110)
* at java.sql.DriverManager.getConnection(DriverManager.java:132)

Here is my code...
...

Class.forName(jdbcDriverClass);
            System.out.println("Opening db connection");
            connection = DriverManager.getConnection(jdbcDriverURL, user,
password);
            statement = connection.createStatement();
// get data
            resultSet = statement.executeQuery(query);
            metaData = resultSet.getMetaData();
            int numberOfColumns =  metaData.getColumnCount();
            columnNames = new String[numberOfColumns];
            columnTypes = new Class[numberOfColumns];
            columnWrite = new boolean[numberOfColumns];
               // Get the column names/types and cache them.
                           // Then we can close the connection.
                            for(int column = 0; column < numberOfColumns;
column++)
                            {
                                columnNames[column] =
metaData.getColumnLabel(column+1);
                                columnTypes[column] =
columnTypeToColumnClass(metaData.getColumnType(column+1));
                                columnWrite[column] =
!metaData.isReadOnly(column+1);
                           }
                // Get all rows.
                rows = new Vector();
                while (resultSet.next())
                {
                    Vector newRow = new Vector();
                    for (int i = 1; i <= getColumnCount(); i++)
                    {
                    newRow.addElement(resultSet.getObject(i));
                    }
                 rows.addElement(newRow);
                            }
            resultSet.close();
            statement.close();
            connection.close();
            System.out.println("Closing db connection");
....

Is there anything wrong or missing?

Thanks, Marco



Sun, 06 Jan 2002 03:00:00 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. JDBC Driver problems

2. JDBC driver problems withDynamic Server 2000

3. MSSQL2000 JDBC Driver Problem

4. Oracle JDBC driver problem?

5. Oracle Thin JDBC Driver: problems streaming long/long raw in parameters

6. SequeLink JDBC Driver problem

7. New Install Question (JDBC Driver Problem - 6.1 under NT SP4)

8. JDBC Driver problems

9. Applet JDBC driver problem

10. JDBC Driver problems

11. JDBC driver problem


 
Powered by phpBB® Forum Software