• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

What's wrong with this code?

Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there:
I'm testing some examples from the book "JDBC Database Access with Java", and I'm getting this error message when I try to run it:
SQLExpection:[Microsoft][Administrador de controladores ODBC]El nombre del origen de datos no se encontro y no se especifico ningun controlador predeterminado.
SQLExpection:[Microsoft][ODBC Drivers Administrator]The name of the data source was not found and a predeterminated driver was not especified.
The code of the program is:

import java.sql.*;

// Create the Coffee Table.
public class CreateCoffees {
public static void main(String args[]) {

String url = "jdbc dbc:CafeJava";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME varchar(32), " +
"SUP_ID int, " +
"PRICE float, " +
"SALES int, " +
"TOTAL int)";
Statement stmt;

try {
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
try {
System.out.println("trying to connect"}"); /* after this line the error is generated. */
con = DriverManager.getConnection(url, "", "");
stmt = con.createStatement();


} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
The database "cafeJava.mdb", is located on the same source directory that this program. Can anybody help me, please?.
Thanks in advance.
rogelio uribe
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jack the Snack, thank you, I missed that point. Everything is running correctly.
I once met a man from Nantucket. He had a tiny ad
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic