Home How to see model class in H2 database
Reply: 1

How to see model class in H2 database

Sezer K.
Sezer K. Published in 2017-12-06 09:41:17Z

I cannot see my tables that I created as model class in h2 database console.

Actually I can access the h2 database (by writing localhost:/h2-console). But I can't see my tables.

Altough I added @Entity annotation, I can not see the table in h2-database.

Product model class:

package com.example;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.math.BigDecimal;

 * Created by jt on 11/6/15.
public class Product implements DomainObject{

    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    private String description;
    private BigDecimal price;
    private String imageUrl;

    public Integer getId() {
        return id;

    public void setId(Integer id) {
        this.id = id;

    public String getDescription() {
        return description;

    public void setDescription(String description) {
        this.description = description;

    public BigDecimal getPrice() {
        return price;

    public void setPrice(BigDecimal price) {
        this.price = price;

    public String getImageUrl() {
        return imageUrl;

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
Sezer K.
Sezer K. Reply to 2017-12-07 07:00:00Z

I solved the problem. I corrected my jdbc url for u2 database. Now, I can see my tables(model class) that I created via java.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305657 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO