cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I am having an application which is having MySQL as its database back end. I am trying to connect that database with Sybase Unwired Platform(SUP2.1).

How can i do that?

Do i need to make connection/synchronization through SQL Anywhere with MySQL as it is a default available database with SUP.

Please suggest.

Regards,

Shrikant.

0 Likes
View Entire Topic
Former Member
0 Likes

Hello All,

I created a connection profile to connect MySQL server and able to connect successfully. But I'm unable to see the existing tables. Can some one help me on this issue.

Thanks
Pavan

Former Member
0 Likes

Hi guys,

i have managed it to connect a MySQL database with SUP, including to create a MBO and i want to share the solution with the community:

First update the "data tools platform enablement" of your Designer   (take care not to update EMF/GMF plugins, this will break your SUP workspace!).

I have only updated the following plugins and deselected everything else:

This will enable  the MySQL driver selection in the connection profile dialog. Put the mysql-connector-java-<version>-bin.jar file somewhere in your sybase installation folder, e.g. Sybase\UnwiredPlatform\MobileSDK<version>\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins. Create your profile and connect to the database. The tables of your schema should now be visible (before the update, they were not showing up). Here is an example:

If you now try to drag and drop a table onto the Mobile Application Diagram canvas you will get a ClassNotFoundException, telling you that the driver class com.mysql.jdbc.Driver could not be found. I did a bit of research and found a post where someone has provided a hack for this issue.

Open the mysql jar file with an archiver and unpack the com folder that contains the driver classes (e.g. on your desktop).

Go to the directory Sybase\UnwiredPlatform\MobileSDK<version>\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins\com.sybase.uep.tooling.api_<version>\lib, open the sup-ds.jar file again with the archiver and package the com folder (of the mysql driver) into the sup-ds.jar (Actually a com folder already exists, so you only have to drag the mysql folder into the jar on the same level as the sybase folder)

After restarting the designer, SUP should now recognize the mysql driver and you can go on and create your MBO, but you have to do it manually (right click on the project and select New->Mobile Business Object in the context menu, since the SQL statement is generated wrong when creating the MBO via DnD. SUP appends the schema name to a table twice and the statement cannot be modified. In my example it would look like this:

SELECT  isbn, title, name, author, price, year_published

FROM amazon.amazon.books

Hope this will help others.

Regards,

Bishara

Former Member
0 Likes

Really helpful

Former Member
0 Likes

Hi Bishara Jaser,


Thank you for your help in this SUP connecting to a MySQL database. I am now able to connect to a MySQL database, however, I followed your post steps and I’m still not able to create MBO’s (in the manual manner that you mentioned). What I did in this regard was:


  1. Go to directory “C:\Sybase\UnwiredPlatform\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins\com.sybase.uep.tooling.api_2.1.3.201205181305\lib” and open “sup-ds.jarwith 7zip.
  2. Go to directory “C:\Sybase\UnwiredPlatform\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins” and open “mysql-connector-java-5.0.8-bin.jar”. I copied the “mysql” folder of folder “com” of this jar and put it in the “com” folder of “sup-ds.jar”.

In the end the “com” folder of “sup-ds.jar” consists of two folders, the copied “mysql folder” and the original “Sybase” folder.

After this I still get the “ClassNotFoundException”. Did I do something wrong or there’s something amiss?

Best regards,

Ricardo

Former Member
0 Likes

Hi Ricardo,

it seems that you have followed the instructions correctly. Did you also update the plugins as suggested?  You might also try to use another MySQL jar file version. The current version is 5.1, which is what i'm using as well.  Do you use SUP WorkSpace 2.1.3? If so, i could  send you the sup-ds.jar via email. I have meanwhile fixed also the drag'n'drop issue mentioned in the post through the modification of another jar file. Tell me your email address and i'll send you both files if you like. In this case you just need to replace the jar's in your installation folder. Maybe we can narrow down the problem this way.

Regards,

Bishara 

Former Member
0 Likes

Hi Bishara,

I also updated the plugins that you mentioned on your post, and yes i am using SUP Workspace 2.1.3. Hence, I would very much appreciate if you could send my email the following files that you are using:

- sup.ds.jar

- The jar file to fix the drag and drop issue (along with the directory where i have to put that jar file)

- mysql 5.1.jar driver

My email is [email protected].

Thank you very much again!

Best Regards,

Ricardo

Former Member
0 Likes

Hi

i am tring to connect the MySql database as backend


i have connected successfully.

when i am deploying the project to unwired server, not able to give the 'Server Connection Mapping' correctly.

it says "the connection profile is doesn't match the server connection profile template"

Do i need to create a connection template in SCC .

Please suggest me a solution...

Regards

Siva Chandu

Former Member
0 Likes

Hi Siva,

sorry for the late response. Yes, you have to create a new JDBC template in SCC under Domains->[your domain e.g.default]-->Connections. Then select the Template tab and enter the database properties similar to the following:

Note that you can choose DB as the database type. Then switch to the Connections tab and create a new connection by selecting the template you've just created.

Click on the Test Connection button to verify that the connection succeeds. Hope this helps.

Regards,

Bishara