Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

connecting to Webtrends reporting DB using JDBC-ODBC

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to connect to Webtrends reporting DB (ODDB)using JDBC-ODBC bridge.
Below is the code snippet i am trying to use and getting the SQL Exception
"Error code is :1012
Exception SQL java.sql.SQLException: [WebTrends ODBC Driver] Database connection string is invalid <DRIVER={WebTrends ODBC Driver}> "

Code goes as below

import java.sql.*;
public class TestWebTrend {
public static void main(String args[]){
TestWebTrend test = new TestWebTrend();
Connection con = test.getConnection();
System.out.println("Connection returned is " +con);
}
public Connection getConnection(){
Connection conn = null;
System.out.println("Inside conncetion object");
try {
// String driverName = "oracle.jdbc.driver.OracleDriver";
String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
Class.forName(driverName);
//String url = "";
//String url = "jdbc:oracle:thin:@157.96.117.109:80:3mxn6tmzifg";
//System.out.println("url :"+url);
conn = DriverManager.getConnection("jdbc:odbc:Driver={WebTrends ODBC Driver};Server=server name;Database=database name" ,"userID","password");

System.out.println("conn iside fucntion :"+conn);
} catch (ClassNotFoundException e) {
System.out.println("Exception ClassNotFoundException "+e);
} catch (SQLException e) {
System.out.println("Error code is :"+e.getErrorCode());
System.out.println("Exception SQL "+e);
} catch (Exception e) {
System.out.println("Exception general "+e);
}
return conn;
}
}


Can some one please help me solving this.

Thanks in advance
Suchitra
 
Bartender
Posts: 2659
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suchitra,

The error message you get is correct. It's not a valid connect string.

A valid string looks like: jdbcdbc:<datasourcename>
(e.g. jdbc:odbc:mydatabase).
The bridge (+ connect string) is documented on the sun java site.

Does your documentation give you a step guide on how to set this up?

Regards, Jan
 
reply
    Bookmark Topic Watch Topic
  • New Topic