Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Scout Explorer and setting up a connection to MySQL
Scout Explorer and setting up a connection to MySQL [message #1810939] Thu, 22 August 2019 10:14 Go to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
I just started with Eclipse Scout in order to evaluate if this could be the right framework for a new project. I have installed Eclipse IDE 2019-06 (4.12.0) and also the Eclipse Scout SDK (9.0.0.018_Simrel_2019_06) and went through the hello world tutorial as well as the Beginners Guide. I now just wanted to connect to a MySQL schema. Searching the internet for help was unfortunately not really successful. I found, that there should be a Scout Explorer, in which there is a technology part where I could change to a MySQL jdbc connection. Unfortunately the Scout perspective is not available in my installation and I have no idea why.

Could you give me a hint what I have to do?

Thanks in advance

[Updated on: Thu, 22 August 2019 10:16]

Report message to a moderator

Re: Scout Explorer and setting up a connection to MySQL [message #1810993 is a reply to message #1810939] Fri, 23 August 2019 07:33 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Faruk

Basically you just need to add the JDBC drivers for MySql to your pom.xml and implement your own MySql Scout-Service that extends AbstractMySqlSqlService, which is shipped with Scout. Please check the following forum threads for more details:

https://www.eclipse.org/forums/index.php/t/1082997/ - I guess you can ignore steps 1-3 unless you work with Docker too, maybe the DB-User setup described in step 3 is relevant for you too, but the important part comes in step 4 and 5. Most likely you will also use a newer version of the "mysql-connector-java" module.

https://www.eclipse.org/forums/index.php/t/1082201/

The info about "Scout explorer" comes from the outdated wiki on eclipse.org. It is not relevant for new Scout versions anymore. You should use the documentation on github.io instead:
https://eclipsescout.github.io/

Maybe you should take a look at the chapter "Creating and Accessing the Database" in the tutorial for the latest Scout versions:
https://eclipsescout.github.io/9.0/beginners-guide.html#sec-contacts_jdbc

And finally: the Scout home-page bundles all important links to documentation and help topics:
https://www.eclipse.org/scout/

I hope that helps.


Eclipse Scout Homepage | Documentation | GitHub
Re: Scout Explorer and setting up a connection to MySQL [message #1811027 is a reply to message #1810993] Sat, 24 August 2019 06:35 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
Hi Andre,

thanks. I found these documents. But unfortunately I am still struggling with step 4.

- I put the two dependencies in the pom. I used the mysql-connector-java 8.0.17, which I am using in a non-scout project, which works fine (but I also tried 5.0.17 with same outcome).
<!-- MySql Database Dependencies -->
<dependency>
<groupId>org.eclipse.scout.rt</groupId>
<artifactId>org.eclipse.scout.rt.server.jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
</dependency>
- I updated the server modules

-I created the service class
import org.eclipse.scout.rt.server.jdbc.mysql.AbstractMySqlSqlService;
public class HelloworldSqlService extends AbstractMySqlSqlService {

but I still get the answer:
AbstractMySqlSqlService cannot be resolved to a type
The import org.eclipse.scout.rt.server.jdbc cannot be resolved

Is there any step I am missing?
Re: Scout Explorer and setting up a connection to MySQL [message #1811049 is a reply to message #1811027] Mon, 26 August 2019 06:00 Go to previous messageGo to next message
The Maddes is currently offline The MaddesFriend
Messages: 44
Registered: October 2018
Member
Hey man,

did you try to update the maven project too?
LIke select the project in project explorer, right click and got to maven-> update project?

Maybe this helps.

Greetings
Re: Scout Explorer and setting up a connection to MySQL [message #1811050 is a reply to message #1811049] Mon, 26 August 2019 06:18 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
yes, I have updated the maven project (several times)
Re: Scout Explorer and setting up a connection to MySQL [message #1811051 is a reply to message #1811050] Mon, 26 August 2019 06:46 Go to previous messageGo to next message
The Maddes is currently offline The MaddesFriend
Messages: 44
Registered: October 2018
Member
Hm,

and you are sure to put it into the server pom.xml and create the service in the server module?
Beacause it seems that the import cannot be resolved.
Re: Scout Explorer and setting up a connection to MySQL [message #1811052 is a reply to message #1811050] Mon, 26 August 2019 06:53 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
<<but I still get the answer: AbstractMySqlSqlService cannot be resolved to a type >>

This is a compile-error, right? This means, something with your project setup is not correct. Most likely your Maven dependencies are not properly loaded. Please make sure that the Error-view shows no POM/Maven errors and the Maven-dependency to "org.eclipse.scout.rt.server.jdbc" shows up in the project explorer of your .server module. That one is important: you cannot access the SQL service from the client module.

If the problem still persists, please post your pom.xml here and a screenshot of your IDE, showing the project explorer with the "Maven Dependencies" folder of your .server module visible.

You could also browse the source code on GitHub of the Contacts demo-app. There you'll see how to integrate the Derby driver/service. The setup for MySql is the same, and just requires another driver and another base class for the Sql service (which you already have).


Eclipse Scout Homepage | Documentation | GitHub

[Updated on: Mon, 26 August 2019 11:05]

Report message to a moderator

Re: Scout Explorer and setting up a connection to MySQL [message #1811178 is a reply to message #1811051] Wed, 28 August 2019 08:26 Go to previous messageGo to next message
Faruk Caglar is currently offline Faruk CaglarFriend
Messages: 33
Registered: August 2019
Member
you are absolutely right, I put the dependencies in the wrong pom file. After using the server pom file it works.

Thanks a lot!!!!

Is there any further more detailed Scout documentation available than the beginners-guide, migration-guide, release-notes, technical-guide, technical-guide-js - e.g. explaining the the handling/usage of AbstractPageWithNodes and what for example the option "Create an Abstract Super Page" in the "Create New Page" wizard means?
Re: Scout Explorer and setting up a connection to MySQL [message #1811188 is a reply to message #1811178] Wed, 28 August 2019 10:35 Go to previous message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
You're welcome!

I guess the beginners guide is currently still the best place to learn something about the Scout wizards. In every chapter you learn something about a Scout concept like a "Page" or a "Form" and with that information in mind it's easy to understand what exactly the wizard does. Basically the wizards are just generators for stubs/boiler-plate code you typically need when you implement a new Page or Form.

Regarding that option "Create an abstract super page": I noticed that the check-box is not documented in the beginners guide and not displayed on the screenshot. Looks like we have to update this document, thanks for the hint :)

What the options does: instead of simply creating a class "HelloWorldPage" that extends AbstractPageWithTable, it creates an additional abstract class "AbstractHelloWorldPage" and the "HelloWorldPage" that extends AbstractHelloWorldPage. This is useful when you want to re-use an existing Page to display data but you want a different search form or you need to load the data from somewhere else or with other constraints.

An example from a CRM application would probably have an AbstractCustomerTablePage and two subclasses AllCustomerTablePage and OwnCustomerTablePage, where the latter restricts data to customers that have a relation to the logged in user.


Eclipse Scout Homepage | Documentation | GitHub
Previous Topic:Refresh Page from Form
Next Topic:Form closing icon (X) presentation also for inactive forms
Goto Forum:
  


Current Time: Thu Apr 25 11:36:35 GMT 2024

Powered by FUDForum. Page generated in 0.04506 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top