I have an SQL which is stored in a String goes like
String s="CREATE TABLE BOOK (page number(20, 0), author varchar2(255), noOfLines number(100))";
I need to write a code that could format my sql as
CREATE TABLE BOOK (page number(20, 0),
author varchar2(255),
noOfLines number(100)
)
What will be the java program to do it.
I tried
sql.replace(", ",", \n");
but this code produced an output like
CREATE TABLE BOOK (page number(20,
0),
author varchar2(255),
noOfLines number(100)
)
As you can see the comma at the number(20, 0) was also considered, but I don't want that.
How to do this?