Help: Connecting Aglet with database

View: New views
4 Messages — Rating Filter:   Alert me  

Help: Connecting Aglet with database

by zuhra sofyan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Struggling for a month  and after searching a sample for a good and easy way to connect an aglet to database, I cannot found it yet. Can someone mail me a sample of aglet program that work with database?

FYI,  I'm using ASDK 2, MySQL version 5.0.18-nt with mysql-connector-java-5.0.5.
I've try it and the last message error I get is something like this:

Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream

** BEGIN NESTED EXCEPTION **

java.io.IOException
MESSAGE: Unexpected end of input stream

STACKTRACE:

java.io.IOException: Unexpected end of input stream
        at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1096)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:626)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
        at com.mysql.jdbc.Connection.<init>(Connection.java:491)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at watcher.WatcherWindow.data(WatcherWindow.java:617)
        at watcher.SampleWindow.handleButton(SampleWindow.java:271)
        at watcher.SampleWindow.handleEvent(SampleWindow.java:249)
        at java.awt.Window.postEvent(Unknown Source)
        at java.awt.Component.postEvent(Unknown Source)
        at java.awt.Component.postEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)


** END NESTED EXCEPTION **


Please help me.  I really need this for my project. You can mail and send the attachment to my email here : zuhra_sofyan@yahoo.com
Thank you before.


Re: Help: Connecting Aglet with database

by Luca Ferrari :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 22 April 2007 zuhra sofyan's cat, walking on the keyboard, wrote:

> Communication link failure: java.io.IOException, underlying cause:
> Unexpected end of input stream

Could it be a firewall problem? Try making a java standalone program that
loads your agent and executes the run method, and see if it can connect to
the database server or there's a problem.

Luca

--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/java?unsub=lists@...


Re: Help: Connecting Aglet with database

by zuhra sofyan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Luca Ferrari wrote:
> Communication link failure: java.io.IOException, underlying cause:
> Unexpected end of input stream

Could it be a firewall problem? Try making a java standalone program that
loads your agent and executes the run method, and see if it can connect to
the database server or there's a problem.

Luca
No, its not, I'm not using any firewall. When I try to use my code in the standalone program, it works fine.
Anyway, when I try to use it in my notebook, this aglets can run ,but when I try to use it in my desktop, it gives me error message:

java.io.IOException: FileNotFound: C:\java\aglets\public\com\mysql\jdbc\Driver.class

Seems like the system cannot execute my mysqldriver. I have load mysqldriver to my system variables (path), but it won't solve the problem. I think it's about missconfiguration but I do'nt know where.
I'm looking for some answer. Thanks before for the patience.

Zuhra



Re: Help: Connecting Aglet with database

by Luca Ferrari :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 8 July 2007 zuhra sofyan's cat, walking on the keyboard, wrote:
> I try to use it in my desktop, it gives me error message:
>
> java.io.IOException: FileNotFound:
> C:\java\aglets\public\com\mysql\jdbc\Driver.class
>

Try to place the jar with your mysql driver into the lib directory of the
aglets installation, and then start tahiti again. It should work.

Luca

--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/java?unsub=lists@...