Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c10449e

Browse files
committed
updated readme, removed username from properies
1 parent 68ce15f commit c10449e

File tree

3 files changed

+83
-3
lines changed

3 files changed

+83
-3
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@
2222
/nbbuild/
2323
/dist/
2424
/nbdist/
25-
/.nb-gradle/
25+
/.nb-gradle/
26+
27+
28+
.DS_Store
29+

Readme.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,79 @@
1+
2+
3+
## what is your application?
4+
Java application can be compiled down to one executable file (ex: .jar, .war). In our case, we will be creating a jar file that will be saved to a directory called __target__.
5+
This can be done from your IDE (ex: Intellij, Eclipse).
6+
```bash
7+
$ mvn clean install
8+
$ ls target
9+
< there should be a bunch of files>
10+
classes
11+
generated-sources
12+
generated-test-sources
13+
maven-archiver
14+
maven-status
15+
postgres-demo-0.0.1-SNAPSHOT.jar
16+
postgres-demo-0.0.1-SNAPSHOT.jar.original
17+
surefire-reports
18+
test-classes
19+
```
20+
to run you application from the command line
21+
```bash
22+
$ java -jar target/postgres-demo-0.0.1-SNAPSHOT.jar
23+
```
24+
## what does your application need to run?
25+
26+
- java 8
27+
- maven
28+
- database (ex: postgres)
29+
- database table
30+
- databese username
31+
32+
You can check this information in the application.
33+
34+
To find the java version, check the pom.xml
35+
```bash
36+
$ cat pom.xml
37+
< lots of stuff will be in here>
38+
...
39+
<name>postgres-demo</name>
40+
<description>Demo project for Spring Boot</description>
41+
42+
<parent>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-starter-parent</artifactId>
45+
<version>2.0.1.RELEASE</version>
46+
<relativePath/> <!-- lookup parent from repository -->
47+
</parent>
48+
49+
<properties>
50+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
51+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
52+
<java.version>1.8</java.version>
53+
</properties>
54+
...
55+
```
56+
57+
```bash
58+
$ cat src/main/resources/application.properties
59+
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
60+
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo
61+
spring.datasource.username=
62+
spring.datasource.password=
63+
64+
# The SQL dialect makes Hibernate generate better SQL for the chosen database
65+
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
66+
67+
# Hibernate ddl auto (create, create-drop, validate, update)
68+
spring.jpa.hibernate.ddl-auto = update
69+
```
70+
71+
In this example, our application uses a postgres database called _postgres_demo_. There is no username or password defined.
72+
73+
74+
75+
76+
---------
177
## Spring Boot, PostgreSQL, JPA, Hibernate REST API Demo
278

379
## Tutorial
@@ -31,4 +107,4 @@ Alternatively, you can package the application in the form of a JAR file and the
31107
```bash
32108
mvn clean package
33109
java -jar target/postgres-demo-0.0.1-SNAPSHOT.jar
34-
```
110+
```

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
22
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_demo
3-
spring.datasource.username= rajeevkumarsingh
3+
spring.datasource.username=
44
spring.datasource.password=
55

66
# The SQL dialect makes Hibernate generate better SQL for the chosen database

0 commit comments

Comments
 (0)