this is my prog its working fine...

public class SqlDataSourceServlet extends DataSourceServlet {

  /**
   * The SQL predefined capabilities set is a special custom set for
SQL
   * databases. This implements most of the data source capabilities
more
   * efficiently.
   */
  @Override
  public Capabilities getCapabilities() {
    return Capabilities.SQL;
  }

  @Override
  public DataTable generateDataTable(Query query, HttpServletRequest
request)
      throws DataSourceException {
    SqlDatabaseDescription dbDescription = new SqlDatabaseDescription(
        request.getParameter("url"),
        request.getParameter("user"),
        request.getParameter("password"),
        request.getParameter("table"));
    return SqlDataSourceHelper.executeQuery(query, dbDescription);
  }



this is the parameter i am passing  am i doing it right?
http://localhost:8084/WebApplication1/SqlDataSourceServlet?url=jdbc:mysql://localhost:3306/test1&user='root'&password='root'&table='emp'

I have a mysql db connected in netbeans framework
db name: test1
user & pwd: root
tablename emp
table "ename"
           hi
           hello

i get error on browser
google.visualization.Query.setResponse({version:'0.6',status:'error',errors:
[{reason:'internal_error',message:'Internal
error',detailed_message:'Failed to connect to database server.'}]});

What must be wrong? I think some problem with parameter passing on url



but when i see the connection to db its ok
i get proper connection

String connectionURL = "jdbc:mysql://localhost:3306/test1";

// declare a connection by using Connection interface
Connection connection = null;

// Load JBBC driver "com.mysql.jdbc.Driver"
Class.forName("com.mysql.jdbc.Driver").newInstance();

/* Create a connection by using getConnection() method that takes
parameters of
string type connection url, user name and password to connect to
database. */
connection = DriverManager.getConnection(connectionURL, "root",
"root");
          Statement stmt;
            String query;
            stmt = connection.createStatement();

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to