amitpith chand

Greenhorn
+ Follow
since Dec 29, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by amitpith chand

no there is no mail server ... please suggest.....
i downloaded window smtp server but it is giving me an error... cannot connect to database
i have mysql server..
now i don't know how to connect smtp server and mysql.
or should i download sql 2008

6 years ago
mail.api.jar...
After including
dsn.jar
imap.jar
mailapi.jar
pop3.jar
smtp.jar

it is giving me following error
Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at Mail.main(Mail.java:27)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
... 7 more
6 years ago
My code is


and the cod is giving me following error--
Exception in thread "main" javax.mail.NoSuchProviderException: smtp
at javax.mail.Session.getService(Session.java:784)
at javax.mail.Session.getTransport(Session.java:720)
at javax.mail.Session.getTransport(Session.java:660)
at javax.mail.Session.getTransport(Session.java:640)
at javax.mail.Session.getTransport(Session.java:697)
at javax.mail.Transport.send0(Transport.java:192)
at javax.mail.Transport.send(Transport.java:124)
at Mail.main(Mail.java:28)
6 years ago
here's my code
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;

public class Testdb {

public static void main(String[] argv) throws ClassNotFoundException, SQLException {

System.out.println("-------- MySQL JDBC Connection Testing ------------");


Class.forName("com.mysql.jdbc.Driver");

System.out.println("MySQL JDBC Driver Registered!");
Connection connection = null;


connection = DriverManager
.getConnection("jdbc:mysql:\\localhost:3306/local MYSQL55","root", "root");



if (connection != null) {
System.out.println("You made it, take control your database now!");
} else {
System.out.println("Failed to make connection!");
}
}
}
output:
-------- MySQL JDBC Connection Testing ------------
MySQL JDBC Driver Registered!
Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:mysql:\localhost:3306/hello
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Testdb.main(Testdb.java:19)
i have added mysql-connector-java-5.1.22-bin.jar .
but still it is giving me error