Binding table to datasource

I'm trying to bind a table to a MySQL data table, but the connection fails. The JSC log reads:

INFORMATIONAL *********** Exception occurred ************ at 10:48 AM on Nov 23, 2006

java.lang.NullPointerException

at com.sun.rave.web.ui.renderer.LinkRenderer.renderEnd(LinkRenderer.java:90)

at com.sun.rave.web.ui.renderer.AbstractRenderer.encodeEnd(AbstractRenderer.java:2 35)

at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:720)

-

And there's much more.

I've defined a valid user and given him a password, which JSC is trying to use to connect. The database is perfectly functional and I can connect to it via a Java class or through the MySQL command prompt.

Configuration values for the datasource are:

Data Source Name: Greenberg Fruit Company

User ID: test01

Password: [irrelevant]

Database URL: jdbc:mysql://localhost/greenberg

Driver Class: com.mysql.jdbc.Driver

The end result is that I get "access denied for user 'test01'@'localhost' to database 'greenberg'

Obviously, if I can't connect to the database, I can't bind the data.

Anyone got any ideas? I've reviewed the tutorials and although they're pretty sketchy on the details, I think I've followed the instructions.

[1326 byte] By [I.RonJack] at [2007-11-26 11:41:57]
# 1

hi

As you said that acess denied to the user test01@localhost, Did you check whether you have sufficient permissions to access the database.

If you have sufficient one then try out whether your database server is at localhost are at remote server. If it also doesnt work then try to check whether your jdbc driver is a valid one or not and some times you require a key file if your jdbc driver is not a valid one .

If this information helps you then its well. If wont then send me the correct error details. i will try to solve that one.

Thanking you.

Srinivasan1983 at 2007-7-7 11:48:22 > top of Java-index,Development Tools,Java Tools...
# 2

I've checked all those things. I can run a Java class that will connect to the database just fine. I've created the user and a valid password, and both are being passed to the connection manager when JSC tries to connect. The database is on my localhost, and I have admin permissions.

The problem seems to be the NullPointerException that is being thrown out of the LinkRenderer. Since JSC generates this method call, I don't know what is supposed to be getting passed that isn't.

I can give you a listing of the error log (StackTrace), but it's pretty long.

IRonJack at 2007-7-7 11:48:22 > top of Java-index,Development Tools,Java Tools...
# 3

I think I may have solved it. My user was not GRANTed access to the particular table I needed.

But I'm still having trouble binding the table data to the UI table. Accordng to the documentation, the Datasources node in the Servers window is supposed to expand to include a TABLES node, which then contains a list of the data tables for that source. The TABLES node in turn expands to display a list of the column_ids for the selected table. It is that column_id that I drag into the UI table to bind the data.

However, my Datasource node does not expand to the TABLES node. When I "refresh" the Datasource, it shows that the connection was successful and validated. But a tiny red "X" remains on the database's icon in the server window, which I assume means something is wrong. I also assume that because the Datasource is not working correctly, I don't get the TABLE view.

Am I on the right track?

IRonJack at 2007-7-7 11:48:22 > top of Java-index,Development Tools,Java Tools...