Andrey Dmitriev

Ranch Hand
+ Follow
since Jan 04, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrey Dmitriev

Tim Moores

  I dont understand now how can I  access  to  database by unit-socket,  using psql.

 In a case of TCP-port  I  run the following  "psql -h remotehost.ru -p 5432 -d test_psql"
  And Postgres is indeed running on your local machine on that port?
 
  Yes.  Application and database mounted on one and the same server with host: remotehost.com.
  TCP-connrction between them is posible, but will be not so fast as by unix-socket
I add to pom dependencies:



And change url to this:



I receive in stack now:

  Yes, I tried.

  In stack:

rg.postgresql.util.PSQLException: Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  Tim Moores,
 I try "jdbc:postgresql://localhost/test_psql" and receive the same error
     
     I use TCP-connection to remote postgre-database by:


   And it working successfully.

   But I cant use UNIX-Socket connection:


    PostgreSQL-version 9.2

   
Greetings to all!
    I have the task to run a java-web-application  in  Plesk-server.

    Since Plesk does not support tomcat java applications directly,  my team-lead set me the following subtasks:
1. locate my web-application in Docker-container;
2. Run this container in sub-domain of Plesk.

   I solved the first subtask successfully. In particular, I added my war in docker-directory, run the container and pushed in Docker Hub-repository.
   Then my repository uploaded in Plesk.

   At the next stage I need to locate files of my web-project in files-directory of domain in Plesk.
   But, I have not clear idea how to do this...  By file-manager I can upload only zip-archive (not war!).
 
2 weeks ago
    The problem is solved (in general):
    working code:


  I hope, it will be use for somebody!
3 weeks ago
    Greetings to all!

    I have a working xml-configuratin:
 

     Also I have "root-class":


    When user is not authorised it passed on "login"-page.

   I try to migrate this configuration to java-formate:


  But it does not work.  User redirected on "meals" (instead "login"  in case of  "non-authorised")
3 weeks ago
  I have found the solution.
  I commented  "<entry key="#{T(org.hibernate.cfg.AvailableSettings).DIALECT}" value="org.hibernate.dialect.SQLServerDialect"/>" in spring-configuation. And now test passing successfully!
  But the reason of success I understand only intuitively yet
     I have tried IDENTITY-strategy, but with the same result...
    Greetings to all!

    I try to insert data in table by using Spring Data JPA + Hibernate.
   
    Before I created table


  And populate with:


  Entity:


   
   repository-class:




   I pass as a genIntColumn-parameter the following: new GenIntColumn(null, 3, 2, 3).   Null-value for id, because this data in table does not exist yet.
   

   But log return:



   As I know, JpaRepository.save-method enable to generate id, while inserting data, if id does not exist, and inserts (updates) values by id, if id exists.
  When I realise UPDATE by this method, everything is well: method updates value, although move the updated row to the end of sequence....
  Thanks a lot!
  I'll try different ways
   Tim Holloway, thanks for detailed and meaningful answer!
   I considered the last approach from among you suggested.

   With using ORM that means, that I need to create one more entity for a separate table.