Export DB2 DDL from One Cell in Google Spreadsheet - java

I have a database change template to used by the team, it was accepted but the only thing needed is:
1- Can we have syntax formatting for SQL within the same form?
2- How can we get only the DDL part out of this to generate a simple text field/file?
Note: This template will be used once per a month and it will have all the database changes, I'm looking for a way to make the syntax to be formatted like the SQL format, and is there a way where I could extract or Export only the queries to one text file even programmatically by using java or any similar programming language.
Please advice and thank you.

Based on the comments I understand that you want to capture a cell value by using Values.get(). You can easily do that by following a quickstart tutorial (available on Java and Node.js as requested). That will help you to set up a working environment with Sheets API. After completing it, you only have to update the code to include Values.get(). Please ask me any additional doubt if required.

Related

how to use PLSQL parser in target language as java

I am newbie in pl sql parsing. I am using porcelli, and gone through this question.
But I am not able to configure this in my eclipse or my local system.
Are there any tutorial or detailed steps for using procelli.
Also I'll be parsing package file. Is porcelli is correct to use?
Once after setting up all, I need to extract all the function and respective params in the package file. How to proceed for that?

SQL Query parser for Java

I am looking for SQL query parser for MySQL queries. Using which I can parse the query, modify the query object and print back modified query
JSQL Parser was exactly what I needed but It has 2 main issues while escaping single quote inside column values
https://github.com/JSQLParser/JSqlParser/issues/167
https://github.com/JSQLParser/JSqlParser/issues/166
So I am looking for open source alternative which can help me with the task
Presto-parser I tried was not able to parse Update queries
If anyone else is aware of any other reliable SQL Parsing library please let me know
Regarding JSqlParser:
Issue 166 already fixed.
The escaping of single quotes is not supported, but using double single quotes is. Therefore someone could replace all \' using '' before parsing.
EDIT: Issue 167 fixed within actual Snapshot 0.9.5 of JSqlParser.
One year ago i search for the same thing but finally i use another approach. Those were the projects that i found to parse sql.
ANTLR. Is commonly used generic parser. It's a kind of parser generator. From a set of rules it writes the java code. There are rules for a lot of thins like spanish, java or sql.
JParsec. Seems similar to the previous one. Seems that already exists SQL rules, but does not seem easy to use.
ZQL. Uses JavaCC to auto-generate Java code that parses the SQL. I test this one but i can not get it working as i want. And i think that the project is discontinued.
sql-parser. It looks nice, but when i tested it i can not get it working. The link seems to not work, but i think that this is a fork of the original project.
jOOQ is a great library for those that don't need or like an ORM and also has a parser.

How to create Report from DB information in PDF format without using jasper

I want to create reports in PDF using the data available in database. I want to do some data manipulation and use the charts and details to be shown in pdf to the user.Suppose say there are 2 columns in DB a and b . I want to show in the PDF, the value of a and b and the addition of a and b. What i can use to generate this pdf report?
I thought of using jasper, but i donot want to use it. Instead is there any other logic in java that can help to solve this problem. Please suggest with examples.
Thanks
Birt is a tool that can be used to generate all sorts of reports. There are plugins for Eclipse that you can use to help you get going and you can definitely add logic in Java. It can output your report in multiple formats including PDF, HTML, and I believe even Word docs.
If you've used Eclipse before you should be able to figure out the basics, but it can get as complicated as you want. In its simplest form you attach data sources (such as a database with a JDBC connection) and you structure your joins and layout fields onto a form. You can even tie it into a Java EE container if needed.
There are examples on their website and it has a rather large community to help with questions.

VBA connection to Java

I have an Excel with some macros. The data is currently sourced manually. In order to automate the report, I need to source the data directly from Oracle database. Unfortunately, this cannot be done, as it is a production database and passwords cannot be shared with anyone.
The next best possible approach is to connect via the Java layer. How can I connect VBA with a Java service?
Any conceptual starting points will also be appreciated.
There is a very nice API from Apache called POI for processing Microsoft documents. http://poi.apache.org/
The other approach is to use OLEDB driver for Excel which will allow you to read data from Excel exactly as you will do from any database using JDBC.
Interop between different technologies likes this is commonly achieved with a combination http and xml.
It's a long time since I saw this done so the technologies might be out of date but you can create a ADO record set from XML.
Excel can make a http call to a Java server that returns the xml. This xml can then be used to create a record set for Excel to consume just as if that record set were obtained directly from the database.

Is there any way dump an IBM Rational Synergy Database through Java?

I was wondering if an API exist that would allow me to dump a synergy database through java. I can create an excel report through IBM Rational Change but it would be nice if there was a way to just send a CCMDB query to the server through java and generate a CSV or XML file and have it dumped locally. Any body know of a possible way to do that?
I would doubt that something exists publicly. You can always call a command line ccm query from java and parse the output. I am working on a Python script that will do something similar, but it will be highly specific to my project DB setup (which is a mess).

Categories