|
|
|
Re: How to work with PostgreSQL? [message #1385810 is a reply to message #1385736] |
Wed, 11 June 2014 11:04 |
barust Mising name Messages: 57 Registered: February 2014 |
Member |
|
|
Hi Jeremie, Mattias.
Thank you for giving me attention!
Through trial and error, I solved this problem. I do not know what was the reason, but after reinstalling PostgreSQL version 9.3.4(currently version) to 9.1.13 everything worked.
Eclipse Scout I really liked, it really is possible to create complex programs.
Thank you!
P.S.: I would like to share my solution, maybe it will help someone.
I am worked on Ubuntu 12.04. Java version "1.7.0_60". Eclipse for Scout Developers(Version: Kepler Service Release 2 Build id: 20140224-0627).
Installing PostgreSQL(version 9.1.13):
In console mode, do next:
-install postgreSQL:
$sudo apt-get update
$sudo apt-get install postgresql postgresql-contrib
-change postgres user password:
$sudo -u postgres psql postgres
\password postgres
(e.g. enter as password 'postgres')
-change the authentication method from peer to md5:
$sudo nano /etc/postgresql/9.1/main/pg_hba.conf
and change the line
#Database administrative login by Unix domain socket
local all postgres peer
to
local all postgres md5
-then reload PostgreSQL:
$sudo /etc/init.d/postgresql reload
-create minicrm database:
$sudo -u postgres createdb minicrm
-reenter PostgreSQL database minisrm
$sudo -u postgres psql -d minicrm
-create Table Company with fields (company_nr, short_name, name):
minicrm=# create table company (company_nr integer not null, short_name varchar(60) not null, name varchar(240) not null);
-you can view result:
minicrm=# \dt
-then insert data to the table Company:
minicrm=# insert into company (company_nr, short_name, name) values(1, 'BSIAG', 'Greate Company BSIAG');
-(optional) insert second data to the table Company:
minicrm=# insert into company (company_nr, short_name, name) values(2, 'BARUST', 'Any Company BARUST');
-show results:
minicrm=# select * from company;
company_nr | short_name | name
------------+------------+----------------------
1 | BSIAG | Greate Company BSIAG
2 | BARUST | Any Company BARUST
(2 rows)
That is all, database minicrm and table company created!
Next step:
From Scout/Tutorial/3.9/Minicrm/Minicrm Step-by-Step:
1) Download, install Eclipse Scout Kepler SR2. (I think it's easy, why does not detail.)http://wiki.eclipse.org/Scout/HowTo/3.9/Install_Scout_SDK
2) Create New Eclipse Scout Project(outline tree with table form). (I think it's easy, why does not detail.)http://wiki.eclipse.org/Scout/Tutorial/3.9/Minicrm/New_Eclipse_Scout_Project
3) Add JDBC Drivers for Eclipse Scout:
-uncheck the box named 'Derby JDBC Driver for Eclipse Scout'.
-check the box named 'PostgreSQL 9 JDBC Driver for Eclipse Scout'.
(for details, see here:http://wiki.eclipse.org/Scout/Tutorial/3.9/Add_JDBC_Drivers_for_Eclipse_Scout)
4) Creating a SQL Service:
-сreate a new AbstractPostgreSqlService
From ('Server' |'Common Services' | 'SQL Services'), right click and open new wizard. For:
-class name type: 'Postgre'
-Super class choose: 'AbstractPostgreSqlService'
(for details, see here:http://wiki.eclipse.org/Scout/Tutorial/3.9/Add_JDBC_Drivers_for_Eclipse_Scout)
-configure properties of PostgreSqlService as next:
@Override
protected String getConfiguredJdbcMappingName() {
return "jdbc:postgresql://localhost:5432/minicrm";
}
@Override
protected String getConfiguredPassword() {
return "postgres";
}
@Override
protected String getConfiguredUsername() {
return "postgres";
}
5) Write the first page.(I think it's easy, why does not detail.)
(for details/ see here: http://wiki.eclipse.org/Scout/Tutorial/3.9/Minicrm/Write_the_first_page).
That's all, your first page with data should appear.
Kind regards
Bahtiyor.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02600 seconds