If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Pervasive, Coldfusion and Linux

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-24-04, 15:23
leteds leteds is offline
Registered User
 
Join Date: Jun 2004
Posts: 1
Pervasive, Coldfusion and Linux

I'm trying to connect to a Pervasive JDBC datasource on a Linux server, using Coldfusion. When adding a Coldfusion datasource I receive the following error:

Connection verification failed for data source: Test
[]java.sql.SQLException: No suitable driver available for Test, please check the driver setting in resources file, error: com.pervasive.jdbc.v2.driver
The root cause was that: java.sql.SQLException: No suitable driver available for Test, please check the driver setting in resources file, error: com.pervasive.jdbc.v2.driver

My settings are:

JDBC URL: jdbc: pervasive://192.168.0.1:1583/Demodata
Driver Class: com.pervasive.jdbc.v2.driver

Can anybody please help?

Ericus Steyn
Reply With Quote
  #2 (permalink)  
Old 06-25-04, 07:53
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
Does the following JDBC sample work? If so, then there's something within ColdFusion. Usually, when I see the type of error you're seeing, it's a Classpath issue. You'll want to make sure that the Pervasive JDBC driver JARs are in the classpath.

Code:
/*
 * SQLStatement.java       
 * Simple JDBC Sample using Pervasive JDBC driver. 
 */
import java.*;
import java.sql.*;
import pervasive.jdbc.*;

     
public class SQLStatement  {

	public static void main(String args[]) {
		  
		String url = "jdbc:pervasive://192.168.0.1:1583/Demodata";
		Connection con;
		
		String query = "select * from class";
		Statement stmt;
		
		try {
			Class.forName("com.pervasive.jdbc.v2.Driver");

		} catch(Exception e) {
			System.err.print("ClassNotFoundException: ");
			System.out.println(e.toString());
			System.err.println(e.getMessage());
			
		}

		try {

			Connection conn=  DriverManager.getConnection(url);

			stmt = conn.createStatement();							
	
			ResultSet rs = stmt.executeQuery(query);
			ResultSetMetaData rsmd = rs.getMetaData();
			int numberOfColumns = rsmd.getColumnCount();
			int rowCount = 1;
			long j = 0;
			
			while (rs.next()) {
				System.out.println("Row " + rowCount + ":  ");
				for (int i = 1; i <= numberOfColumns; i++) {
					System.out.print("   Column " + i + ":  ");
					System.out.println(rs.getString(i));
				}
				System.out.println("");
				rowCount++;
			}
			stmt.close();
			conn.close();

		} catch(SQLException ex) {
			System.err.print("SQLException: ");
			System.err.println(ex.getMessage());
		}	
	}
}
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On