All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.innodb.java.reader.ShowOnePageMain Maven / Gradle / Ivy

There is a newer version: 1.0.10
Show newest version
/*
 * Copyright (C) 1999-2019 Alibaba Group Holding Limited
 */
package com.alibaba.innodb.java.reader;

import com.alibaba.innodb.java.reader.page.AbstractPage;
import com.alibaba.innodb.java.reader.schema.Column;
import com.alibaba.innodb.java.reader.schema.TableDef;

/**
 * @author xu.zx
 */
public class ShowOnePageMain {

  public static void main(String[] args) {
    TableDef tableDef = new TableDef()
        .addColumn(new Column().setName("id").setType("int(11)").setNullable(false).setPrimaryKey(true))
        .addColumn(new Column().setName("a").setType("bigint(20)").setNullable(false))
        .addColumn(new Column().setName("b").setType("varchar(64)").setNullable(false));
    String ibdFilePath = "/usr/local/mysql/data/test/t.ibd";
    try (TableReader reader = new TableReaderImpl(ibdFilePath, tableDef)) {
      reader.open();
      AbstractPage page = reader.readPage(3);
      System.out.println(page.toString());
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy