Hooking MariaDB DyanmicColumn into Java Spring - java

Been playing with MariaDB and really enjoy the NoSQL aspect of MariaDB in that we can add JSON into a column and do combined query for the Relational and the JSON part of a record. More info here: https://mariadb.com/kb/en/mariadb/dynamic-columns/
I'm not trying to hook MariaDB into my code.
Following this page https://springframework.guru/configuring-spring-boot-for-mariadb/ been able to connect to MariaDB from Java code, add and edit data like a normal relational database.
Thought I'm not sure how to use the NoSQL aspect of it from Java.
Namely adding a Blob column that will contain JSON - what Java Data type represent it. And how do querying.
I've been doing alot of research on web and couldn't find anything. Any assistance appreciated.

You will have to set the Query parameter to = "" ; Try it and post the results.

Related

fast data search using java from oracle database

In an Oracle database I have like more than 178692 rows regarding to a store items. I need to develop regular web application using java and front-end will be plain html. is there any caching modular way to retrieve data from the front-end.
Bellow are my column headers and are all String of data type.
enterITM_DESC = *CHOCBOX WHITE CHOCOLA.BAR 50G,
ITEM_CODE=GRCO66760,
PLU_CODE =23270 code here
I need my searching functionality to be implemented item_desc and item_code will be the key for any instance.
Your help matters a lot thanks in advance.

create Dynamic columns in maria db using spring boot with jpa

I have using maria db to store dynamic columns.In sql Query it is there in the maria db documentation. https://mariadb.com/kb/en/library/dynamic-columns/ .
But i couldn't find a spring boot jpa implementation.I have tried jpa native query.I am storing a Json in this dynamic column which is data type of Blob in maria db.But it is very tough because i couldn't find a way to store when json is nesting another objects or arrays.Is there any way to accomplish this task
JSON is just a string. It could be stored in a TEXT or BLOB column.
The issue is that it is a structured string and it is tempting to reach into it to inspect/modify fields. Don't. It won't be efficient.
Copy values out of the JSON that you need for WHERE or ORDER BY (etc) so that MySQL/MariaDB can efficiently access them. Sure, keep copies inside the JSON text/blob, if you like.
Please describe your use for JSON, there may be more tips on "proper" usage inside a database.
That being said, MariaDB 10.2 has picked up much of Oracle's JSON. But there is not a JSON datatype. And there are a few function differences.
And this does not explain how far behind the 3rd party software (spring-boot, etc) is.

MariaDB Dynamic Columns integration in Java

I am working on Proof of concept regarding the integration of MariaDB Dynamic column concept with Java. So the problem is the column will be in BLOB and the data will be stored in key - value pairs. Currently when byte[] is returned from the database doesnot have any JSON object format or any separators. So its very hard to parse the data and find the value for a key. This can be done using Native queries in Java. But how to retrieve data using JPA/Hibernate or will they support Dynamic columns?
Thanks in Advance.
Have you tried to retrieve the data as COLUMN_JSON(dyncol)? Read more about it here: https://mariadb.com/kb/en/mariadb/column_json/

Selecting individual data_types across mutliple tables using SQL and HQL from Oracle

Hello World, Here is the situation,
Basically instead of generating values from a table like like so
34.324, 09/13/2011, thankyou,
I would like to generate the type of that specific value
e.g
VarChar2, Date, varchar2(char 30)
Just to add another layer of difficulty a Java application pulls data from the multiple Oracle database tables using HQL. Thus I would need an equivalent HQL statement to the SQL statement (if it exists)..
I understand the DESC keyword lists the column data types for an entire table however as mentioned above I require specificity.
In Summary
I would like to reverse engineer this application to generate a report of the data_types of the data instead of the actual data itself. I could easily just manually walk through the code however they are over 200 entries and this will be a real pain.
Any help is truly appreciated. If this question is unclear please let me know and I will provide more details and examples.

Get all the index information for a given schema -- db2

I am writing a JDBC program to fetch some database meta data information and as part of that I want to query all the indexes that are there in a given schema.
I had a look at some JDBC API and from DatabaseMetaData interface, can use methods like getTables to get all the tables for a given schema. I am trying to find something similar (or write using a combination of some API) to get information like all the indexes,views etc on a schema. Is there a way to get it? For ex, for index there is a method - getIndexInfo but for each of the table in a schema, I need to call this method. My database is db2.
I would use the DB2 Catalog Views to get the information.
As an example, if you want all of the indexes for a table, you'd use a query like this (I'm assuming you're using DB2 on Linux/Unix/Windows here):
SELECT *
FROM SYSCAT.INDEXES
WHERE tabname = #tablename
AND tabschema = #schema
ORDER BY indname
I did the following after trying some approaches
1. Wrote a wrapper around JDBC calls to simplify my work.
2. Queried the syscat schema like
select tabname from syscat.TABLES where tabschema = ?
Wrote some java utilities to compare the 2 sets of results returned by the 2 schema and also did some manual comparison.
If I find a better solution, will post it. Thanks a lot for all the help.
Getting data from Syscat schema is not correct. in ZOS environment Syscat may be or may not be present because while installation you have options not to install the Syscat schema. so better use Sysibm schema.

Categories

Resources