GeeCON Prague 2014*
The moose likes JDBC and the fly likes Server configuration denies access to data source Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Server configuration denies access to data source" Watch "Server configuration denies access to data source" New topic
Author

Server configuration denies access to data source

rahul soni
Greenhorn

Joined: Aug 22, 2005
Posts: 24
I written connection code but it thorw "Server configuration denies access to data source" this exp
my code is(help me)

import java.sql.*;
import javax.sql.*;
public class Mycon
{

public static void main(String args[])
{Connection con;
Statement st;
ResultSet rs;
try
{
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Class.forName("org.gjt.mm.mysql.Driver");
System.out.print("CON");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/pune","Rahul","pratik");
st = con.createStatement();//createStatement()
rs=st.executeQuery("select * from Author");
while(rs.next())
{System.out.print(rs.getString(1));}
}catch(Exception e){System.out.print(e.getMessage());}
}
}
 
GeeCON Prague 2014
 
subject: Server configuration denies access to data source