Skip to content

GettingStarted

Yong Zhu edited this page Aug 14, 2018 · 2 revisions

Configuration

jDialects need Java6 or above, put below in pom.xml:

	<dependency>  
		<groupId>com.github.drinkjava2</groupId>  
		<artifactId>jdialects</artifactId>  
		<version>2.0.2</version>  <!-- or new version -->
	</dependency>

Or download "jdialects-x.x.x.jar" from Maven central

The first demo:

import com.github.drinkjava2.jdialects.Dialect;
public class Demo{
  public static void main(String[] args) {
    System.out.println(Dialect.Oracle12cDialect.paginAndTrans(3, 10,
                "select concat('a','b','c'), current_time() from user_tb"));
    }
}

output:
select 'a'||'b'||'c', current_timestamp from user_tb offset 20 rows fetch next 10 rows only