This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Connection Factory (Connection String) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Connection Factory (Connection String)" Watch "Connection Factory (Connection String)" New topic
Author

Connection Factory (Connection String)

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Hi guys,

please help me I have the following class

Vide:

package br.com.caelum.tarefas;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionFactory {

public Connection getConnection() throws SQLException {
System.out.println("conectando...");

try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
throw new SQLException(e);

}
return DriverManager.getConnection("jdbc:mysql://localhost/fj21",
"root", "root");
}

}





I would like to know if were the login entered wrong insted of the stack trace I wanna put a personalized page .jsp... How can I do it?

bye bye,
André AS
São Paulo - Brasil


André AS
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Connection Factory (Connection String)
 
Similar Threads
Newbie having problems with StrutsMocktestCase
NullPointerException - connecting it mySQL
connecting to mysql, with java, on a mac
this code not compiling! why?
SQLException: Callable statments not supported.