News AggregatorBig Data: Are We Looking at the Wrong "V"s?Aggregated on: For once, business people are excited about the importance of data and are interested in the business benefits of extracting insights from the data. Perhaps this is more of a cultural rather a technical initiative, and so we in the data industry should participate by redefining the concept of the three Vs to reflect business values rather than technical challenges. View more...DBmaestro: A Complete SaaS SolutionAggregated on: In January 2016, I reviewed the 4.8 version of DBmaestro, which provided the following conclusion: DBmaestro has dedicated their efforts toward filling the void of source control at the database level. Their products are focused at being the best of breed for the database vendors they support. While I wish they offered support for more databases than Oracle and Microsoft SQL Server (hint: PostgreSQL), I understand their decision to start with two of the market leaders and possibly expand from there. View more...Backups as a Cloud Service - an Alternative ViewAggregated on: In most databases, very small percentage of data changes between SQL Server backups. We tolerate this because it keeps things simple, and we have grown used to cheap storage and fast networks. To exploit the value of Cloud services, should we be rethinking this in favour of backup strategies that optimise resilience and minimise downtime? View more...DevOps Your Skill: Unit TestsAggregated on: A unit test is a method that calls functions or pieces of code from your source code with some inputs and then validates if the output is the one that you want to expect. Thus, these tests validates if the result is the one expected. The method or function to be tested is known as System under test (SUT). These tests are automated in the continuous integration system (CircleCI) and are executed in each new version of the software. View more...Uploading Data to Windows Azure SQL DatabaseAggregated on: One way of getting the advantages of the Cloud without having to migrate the entire database is to just maintain a copy of the data that needs to be accessible to internet-based users in Windows Azure SQL Database. There are various ways of keeping the two in sync, and Feodor describes a solution based in using SSIS View more...DevOps Your Skill: VUI (Voice User Interface) TestsAggregated on: According to the Wikipedia definition, "a Voice User Interface (VUI) enables human interaction with computers through a voice/speech platform to initiate automated processes or services. VUI is the interface of any speech application." Thanks to machine learning, big data, cloud, and artificial intelligence, we have managed to communicate with "computers" through the most natural way of communication of the human being: speech. View more...Data Science Laboratory System - Programming and Scripting LanguagesAggregated on: Although every computer language is suitable for data, some languages lend themselves especially well for working with certain types or sources of data, or processing the data in certain ways, and so are of particular use to the data scientist. View more...Configuring Graceful-Shutdown, Readiness and Liveness Probe in Spring Boot 2.3.0Aggregated on: The Spring Boot team has recently announced the release of version 2.3.0 release, which comes with lot of enhancements, upgrades and features (release notes). Specifically, the Spring team announced early on that release 2.3 would be focused on Kubernetes. With that in mind, this article we will try to explore some of those features. View more...Azure SQL Database MaintenanceAggregated on: It is increasingly likely that DBAs are now given responsibility for maintaining Azure SQL databases as well as conventional SQL Server databases. What is likely to be required by way of maintenence? What are the differences? View more...Couchbase Eventing: Small Scripts hat Solve Big Problems at ScaleAggregated on: Eventing: Simple Yet Powerful Eventing allows small scripts to overcome hard to solve problems. First off, let's look at the basic Eventing Lifecycle. The steps below show how easy it is to write and use an Eventing Function: Add (or import) an Eventing Function via Couchbase Server's UI. Assign a data source, a scratchpad bucket, and some bindings to manipulate documents or communicate with the outside world. Implement some JavaScript code to process the received mutation. Save your new Function and hit "Deploy" That's it; you now have a distributed function responding to mutations in your data set in real-time across your entire cluster. The Eventing service provides an infrastructure-less platform that can scale your Eventing Functions as your business experiences growth whether a one-time spike or a monthly increase in data stores or clients served without concern for the fact that your JavaScript-based Eventing functions are running in a robust reliable parallel distributed fashion. To learn more about Couchbase Eventing please refer to the Eventing Overview in our documentation. The examples in this article below show that in some cases Eventing can act like a drop of oil to needed "free up" the moving parts of your applications. View more...Planning for Failure in Cloud ApplicationsAggregated on: Any IT application will suffer a failure at some point. A well-designed application can accomodate failure by reacting in such a way as to minimise the effect: to fail gracefully. Good Cloud software design should plan around mitigating the consequences of failure of any part of the system View more...Hazelcast: Introduction and ClusteringAggregated on: Every time I read the term Hazelcast, it makes a picture of some weather forecast in my mind like a forecast of hazy situations. According to Wikipedia, Hazelcast IMDG is an open-source in-memory data grid based on Java. Hazelcast provides central, predictable scaling of applications through in-memory access to frequently used data and across an elastically scalable data grid. These techniques reduce the query load on databases and improve speed. Hazelcast is now one of the renowned caching technology in the market associated with distributed computing. View more...Data Science Laboratory System - Interactive Data ToolsAggregated on: Data tools interact directly with data and are great for automating data data-aquisition, but they aren't always the best way to prototype or pilot a process. Interactive data tools also allow you to test and refine the process, until it is ripe for automation. View more...Top 10 Skills to become a full-stack Java DeveloperAggregated on: I often receive emails from my readers about how they can become a full-stack Java developer, what things they should learn, and which area they can work on to become a Rockstar Java developer. After answering them individually over the last few years, I thought to jot down a couple of points which I think will make you a better Java Programmer and Full-stack Application developer. View more...Database Cloud Backup CribsheetAggregated on: A secure cloud-based file system that can provide offsite backup is better than no offsite backup, but is there a beter way? Are there more opportunities in offsite backup for improving disaster recovery, or providing a scalable archive? View more...Kubernetes AuditingAggregated on: Auditing is an essential administrative input to understand the way a system is affected or being used. An audit trail is a log of the sequence of chronological events that occurred on a system. It helps administrators understand what event occurred, when did it take place and the trigger or the source of the event. It is also a compliance or legal requirement for many businesses and so an important part of IT systems. In this tutorial, we will look at how to do auditing in Kubernetes. Introduction A simple example of an audit log in the context of Kubernetes would be read as View more...Data Science Laboratory System - InstrumentationAggregated on: It is sensible to check the performance of different solutions to data analysis in 'lab' conditions. Measurement by instrumentation makes it easier to develop systems that are efficient. View more...Kubernetes Pod Security Policies with Open Policy Agent (OPA)Aggregated on: Kubernetes is the most popular container orchestration platform in today's cloud-native ecosystem. Consequently, Kubernetes is also an area of increased interest and attention. In this blog post, first I will discuss the Pod Security Policy admission controller. Then we will see how Open Policy Agent can implement Pod Security Policies. In fact, during Kubernetes SIG Auth at Kubecon + CloudNaticeCon North America 2019, Open Policy Agent/Gatekeeper was touched upon as a potential alternative to Pod Security Policy. View more...OAF : Trace OAF PagesAggregated on: To enable diagnostic for specific user set Profile Option FND: Diagnostics to YESSee this article about profile option Now login at application, you will find in global buttons "Diagnostics" link, click it.Enter the follwing Diagnostic: Show Log on Screen Log Level : Statement (1)Module : % Now Click go buttonNow when opening any page at application you will find trace at button of page.Thanks View more...Using Startup Command to Pass Command Line Arguments to Azure App Service for LinuxAggregated on: Azure App Service on Linux has several prefabricated Docker images that support applications written in languages such as .NET core, PHP, and Node.js. App Service also supports using your own Docker image to spin up a container for your application. A useful configuration feature of App Service on Linux is the Startup File configuration that you can set as part of configuring the runtime stack. The value that you specify for the configuration overrides the CMD instruction of the Dockerfile that creates the runtime of the application. If you are not aware of this configuration option, we will soon deploy an application that uses this configuration option soon, so keep reading. The Docker documentation states that if your Dockerfile has both CMD and ENTRYPOINT instructions, then CMD arguments are appended to the end of the command generated by the ENTRYPOINT instruction. A necessary condition for this feature to work is that you must use the exec form of the ENTRYPOINT instruction in your Dockerfile. In simple terms, assume that your Dockerfile has the following instructions. View more...OAF : Programatically Add Region to OA PageAggregated on: Sometimes in OAF, you want to add a region to OA Page.For example i had a requirement to add employee summary region to another page.Employee Summary Page exists at MDS at this path "/oracle/apps/per/selfservice/common/webui/AsgSummaryRN".Application module that is used with this region is "oracle.apps.per.selfservice.common.server.SummaryAM" I wrote the following code to add this page to another page at controller of OA pageipublic void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OATableLayoutBean empSummaryBeean = (OATableLayoutBean)this.createWebBean(pageContext, "/oracle/apps/per/selfservice/common/webui/AsgSummaryRN", "AsgSummaryRN", true); empSummaryBeean.setApplicationModuleDefinitionName("oracle.apps.per.selfservice.common.server.SummaryAM"); empSummaryBeean.setStandalone(true); webBean.addIndexedChild(0, empSummaryBeean);}Thanks View more...Consul Deployment Patterns - A Brief OverviewAggregated on: While delving into service mesh, key-value store, or a service discovery solution in cloud-native space, you would have definitely come across Consul. Consul, developed by HashiCorp is a multi-purpose solution which primarily provides the following features: Service discovery and Service Mesh features with Kubernetes Secure communication and observability between the services Automate load-balancing Key-Value store Consul watches This blog post briefly explains what are the deployment patterns for the Consul to watch configuration changes stored in the Key-Value store. It will explain how to discover and synchronize with the services running out of the Kubernetes cluster. We will also see how to enable Service Mesh feature with Consul. We broadly categorize Consul deployment patterns as In-cluster patterns (Consul deployed in Kubernetes cluster) and Hybrid pattern (Consul deployed outside the Kubernetes cluster). View more...OAF : Configure Jdeveloper for OAFAggregated on: Developers use specific version of Jdeveloper to extend or customize OAF pages.Each Oracle OAF framework has specific version of Jdeveloper used with it.Before configuring jdeveloper you must know current OAF version used by Oracle EBS.To get OAF version used by your instance, login at application and click "About this page" link on the left button of OA page and select "Technology Components" tab.After knowing your OAF framework version , login at Oracle Support and open Note ID: ID 787209.1 - How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.Download correct Jdeveloper patch and extract anywhere at your machine.Follow the following steps to configure Jdeveloper1- Specify Path of jdeveloperRight click on My Computer, select Properties, click System Properties, Select Advanced tab , Click Environment Variables as given below screen shotVariable name : JDEV_USER_HOMEVariable value : <>2- Download DBC fileDownload dbc file for this path $FND_TOP/secure at application server to local machine folder <>\dbc_files\secure3- Create Database ConnectionOpen jdeveloper.exe from jdevbin folder Select Connection Navigator, right click on Database and select New Database Connection In step1write Connection Name and choose Oracle(JDBC) at Connection TypeIn step2 fill user name and password and deselect Deploy PasswordIn step3 fill connection detailsIn step4 you can click test connection4- Project Properties After creating workspace and project, click right click on project and select Project Properties Select Business Compoenent in left pane, select from drop list your connectionSelect Oracle Applications > Runtime Connection Fille the followingDBC File Name : path of dbc file that was downloaded at previous stepUser Name : application user namePassword : application user name passwordApplication Short Name : Enter short name of the responsibility that when running page in Jdeveloper local will run under this responsibilityResponsibility Key : Key of responsibility. Thanks View more...Introducing : Tracing Cassandra With JaegerAggregated on: Monitoring and debugging microservices and distributed systems is not trivial. With the rise of containers and ephemeral infrastructure, it is even more critical to have all the data available for the applications. The monitoring as of today is usually done across three axes: metric monitoring, logs, and distributed tracing Stop reverse engineering applications and start monitoring from the inside. View more...OAF : Disable Global Buttons in PageAggregated on: I write snippet code to disable global buttons in OAF page.You can add the following code to Controller class of the page that you want to disable global buttons inside it. public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAPageLayoutBean pageLayoutBean = (OAPageLayoutBean)pageContext.getPageLayoutBean(); pageLayoutBean.prepareForRendering(pageContext); OAGlobalButtonBarBean globalButtonsBean = (OAGlobalButtonBarBean)pageLayoutBean.getGlobalButtons(); globalButtonsBean.setRendered(false); }Thanks View more...Akka HTTP From Zero to Heroku in 10 MinutesAggregated on: This article is for newbies to Akka HTTP and for those who have written some Akka HTTP but have never deployed their own server. Here I'll teach you what you need to know and do so that you have your first server up and running on Heroku in just a few minutes. This article is also available over at the Rock the JVM blog or in video here (where I'll explain some additional things) or right below: We'll be working in IntelliJ IDEA which creates an SBT project structure quickly, but you can also use the sbt command line to do the same things we do here. So here goes: Step 1 - Intro We'll start by creating a vanilla Scala-SBT project in intelliJ: View more...Route HTTP to HTTPS in HttpClientAggregated on: I published before an article about JAVA : Get html Page Source through Website URL that HttpClient was used to send Get method and get Response.Sometime developer want to route Http to Https when invoking Urls.So You can use WebClientWrapper.wrapClient to do this issue.import java.security.cert.CertificateException;import java.security.cert.X509Certificate;import javax.net.ssl.SSLContext;import javax.net.ssl.TrustManager;import javax.net.ssl.X509TrustManager;import org.apache.http.client.HttpClient;import org.apache.http.conn.ClientConnectionManager;import org.apache.http.conn.scheme.Scheme;import org.apache.http.conn.scheme.SchemeRegistry;import org.apache.http.conn.ssl.SSLSocketFactory;import org.apache.http.impl.client.DefaultHttpClient;public class WebClientWrapper { public static HttpClient wrapClient(HttpClient base) { try { SSLContext ctx = SSLContext.getInstance("TLS"); X509TrustManager tm = new X509TrustManager() { public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException { } public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException { } public X509Certificate[] getAcceptedIssuers() { return null; } }; ctx.init(null, new TrustManager[] { tm }, null); SSLSocketFactory ssf = new SSLSocketFactory(ctx); ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); ClientConnectionManager ccm = base.getConnectionManager(); SchemeRegistry sr = ccm.getSchemeRegistry(); sr.register(new Scheme("https", ssf, 443)); return new DefaultHttpClient(ccm, base.getParams()); } catch (Exception ex) { ex.printStackTrace(); return null; } }}Thanks View more...Elastic 7.6.2 - LDAP RealmAggregated on: It is a short howto guide which shall talk about adding a LDAP realm to an elasticsearch 7.6.2 cluster. Realms It is a concept not alien to IDAM professionals. In simple words it is a system that allows you to authenticate and authorize an incoming request. It will define the entity USER, that may include at a bare minimum (not limited to) View more...JAVA : Get html Page Source through Website URLAggregated on: To get source code of website page you can use HttpClient ,I will send GET method and then get response.The response has content of website URL.I used Apache HttpClient package to implement this task.In this Class I used getStringFromInputStream method that was I was posted before in Convert InputStream to String.here you can find Class do this taskNote I use static method WebClientDevWrapper.wrapClient, you can find its code in the article Route HTTP to HTTPS in HttpClientimport java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.client.methods.HttpGet;import org.apache.http.client.HttpClient;import org.apache.http.impl.client.DefaultHttpClient;public class WebsiteSource { public static String getSource(String url) throws Exception { String retValue = ""; HttpClient httpclient = new DefaultHttpClient(); WebClientDevWrapper.wrapClient(httpclient); try { HttpGet httpget = new HttpGet(url); // Execute HTTP request HttpResponse response = httpclient.execute(httpget); //Get status : Response Ok will be HTTP/1.1 200 OK System.out.println(response.getStatusLine()); // Get hold of the response entity HttpEntity entity = response.getEntity(); if (entity != null) { InputStream instream = entity.getContent(); try { retValue = WebsiteSource.getStringFromInputStream(instream); } catch (RuntimeException ex) { httpget.abort(); throw ex; } finally { // Closing the input stream will trigger connection release try { instream.close(); } catch (Exception e) { } } } } finally { httpclient.getConnectionManager().shutdown(); } return retValue; } private static String getStringFromInputStream(InputStream is) { BufferedReader br = null; StringBuilder sb = new StringBuilder(); String line; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { sb.append(line); } } catch (IOException e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } return sb.toString(); } public static void main(String[] args) { try { String content = WebsiteSource.getSource("http://mahmoudoracle.blogspot.com/"); System.out.println(content); } catch (Exception e) { e.printStackTrace(); } }}Thanks View more...Kubernetes Pod Security PoliciesAggregated on: Kubernetes was not famous for its security features when it was first introduced as a container orchestration system, but the platform has evolved a lot over the years. Aside from being portable and infrastructure-agnostic, Kubernetes also offers a wide range of security features and tools that can help you harden the security of your apps and services. Pod security is one of the ways you can safeguard your entire cloud ecosystem. Kubernetes Pod Security Policies are basically a series of policies that govern how Pods interact with the host operating system and other resources within the cluster. It defines the conditions under which Pods are allowed to run and use cluster resources. View more...JAVA : Convert InputStream to StringAggregated on: You can use the following snippet to convert InputStream to String private static String getStringFromInputStream(InputStream is) { BufferedReader br = null; StringBuilder sb = new StringBuilder(); String line; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { sb.append(line); } } catch (IOException e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } return sb.toString(); }Thanks View more...Implementing Multitenancy on Hyperledger Fabric Using KubernetesAggregated on: As a platform for enterprise blockchain solutions to achieve modularity, trust, and transparency, Hyperledger Fabric has gained immense traction due to its ability to provide a secure, permissioned, and private platform for business transactions. Designed specially to encourage cross-industry collaborations, Hyperledger Fabric enabled multiple execution of transactions to enhance system scalability. In Hyperledger Fabric 2.0, chain code script components are embedded within Docker containers which then have to be installed on each and every peer on the network. Docker swarms or Kubernetes(details below) are then used to deploy these components on the Fabric network. View more...OAF OverviewAggregated on: This post will explains some terminologies that is used in Oracle Application Framework (OAF).Entity Object - business component entity objects maps to database table or view that allow DML operations and that used to cache data result set and perform validation before post changes to database. Association Object - business component association objects implement the relationships between different entity objects and can mapped to database referential integrity constraint or non existing referential integrity constraint and this case constrain will be validated in OAF but not in database. View Object - business component view objects are used to display data in UI pages and it can be based on1- Entity Object or many entity objects and this case it supports DML operations.2- SQL queries : that's doesn't support DML operations3- Static : Programmer create structure of view object attributes and can add static data also.4- Programmatic : Programmer write code at runtime to get dynamic data of view object.View Link - Establishes a master/detail relationship between different view objects and can be in more depth master/detail/detail/....Validation View Object - A view object created exclusively for the purpose of performing light-weight SQL validation on behalf of entity objects or their experts.Application Module - An application module is a container for related BC4J objects. The AM is connected to the database, and is responsible for the commit and rollback of a transaction. Validation Application Module - An application module created exclusively for the purpose of grouping and providing transaction context to related validation view objects. Typically, a standalone entity object or the top-level entity object in a composition would have an associated validation application module.Root Application Module - Each pageLayout region in an OA Framework application is associated with a "root" application module which groups related services and establishes the transaction context.This transaction context can be shared by multiple pages if they all reference the same root application module, and instruct the framework to retain this application module (not return it to the pool) when navigating from page to page within the transaction task.Entity Expert - A special singleton class registered with an entity object (EO) that performs operations on behalf of the EO.Controller - The controller is the java code in charge of loading a page when we call it. It is also in charge of handling an event on a page, like a click on a button, or the call of a List Of Values. Attribute Set - Bundles of region or item properties that can be reused either as is or with modifications. For example, all buttons sharing the same attribute set would have the same label and Alt text. Thanks View more...ESB Logging (Part 1)Aggregated on: Introduction Logging is a necessary cross-cutting concern in any software system, and specifically also for an Enterprise Service Bus (ESB).This article is the first of a two: in this one (part 1) I am going discuss what functionality an ESB logging system should have, while in the second article (part 2) I will introduce some techniques to implement this functionality. Note on terminology: in these articles I am going use the somewhat older terms of ESB Service Component and ESB Service Component Endpoint, to generically refer to ESB components and their exposed endpoint, respectively, regardless of technology, communication protocol, and exchange pattern. So the discussion is equally applicable to ESB components that expose REST API, a SOAP Web Service, a Websocket, or are triggered via a queuing mechanism. View more...ADF : Working with ViewCriteriaAggregated on: View Criteria's are additional where clause added at runtime to base View Object Query. Programmer can create view criteria declaratively or programatically. 1. Create View Criteria Declaratively Open View Object in Edit and in "Query" tab you can click "+" add pencil to create new view criteria 2. Control View Criteria Programatically. a- Get View Criteria from View Criteria manager within View Object and then apply it ViewCriteria applyVC = myViewObject.getViewCriteria("MyViewCriteriaName");myViewObject.applyViewCriteria(applyVC);myViewObject.executeQuery();b- Applying Multiple view Criteria's When multiple view criteria's are applied to the view object, the view criterias gets appended or replaced depending upon the way you use applyViewCriteria APIReplacing Existing view criteria's : myViewObject.applyViewCriteria(applyVC) ormyViewObject.applyViewCriteria(applyVC,false)will erase all previously applied view criterias and apply the current view criteria only.Appending to the Existing view criteria:myViewObject.applyViewCriteria(applyVC, true) Will append this view criteria to the existing view criteria(s) which is applied already.c- Unapplying && Removing View Criteriavo.removeApplyViewCriteriaName()Unapply the view criteria if it is applied. The view criteria will still remain in View Criteria Manager (which means you can't apply this view criteria whenever you require in the future).vo.removeViewCriteria() Removes the view criteria from View Criteria Manager. If it is applied it is first unapplied and then removed. (which means you cant apply this View Criteria to the view object next time in the future.).For example the below code returns null after removeViewCriteria has been applied.ViewCriteria applyVC = myViewObject.getViewCriteria("MyViewCriteriaName")vo.clearViewCriterias() Unapplies and removes all view criteria, both applied and unapplied from View Criteria Manager. Which means that you can't apply any View Criteria against View Object.For example the below code returns null after clearViewCriterias() has been applied.ViewCriteria applyVC = myViewObject.getViewCriteria("MyViewCriteriaName")myViewObject.applyViewCriteria(null) The above statement unapplies all existing View Criterias and not remove it.myViewObject.setNamedWhereClauseParam("MyParameter", "myValue)The above statement set Named Parameter Value. It set the value of "MyParameter" to "myValue".I post in previous post about ADF : Change View Criteria Columns at Runtime Thanks View more...Integration of Salesforce Apex API With MuleSoftAggregated on: Here we are going to Build one sample Salesforce Apex Api and further, we will use the MuleSoft apex connector to access the Apex API. In this example, we will build one sample Apex API which will be fetched out all the Account name and phone number from the salesforce, and then we will build one Mulesoft rest API which will further access the salesforce apex API and then return the payload in response. So let's follow the below steps to build the Example. View more...Random Numbers in JavaAggregated on: Previously I posted about Generate Random Passwords in Oracle that was using PLSQL.Today I will post about java randoms.Java provides two classes to generate random numbers: Random and SecureRandom.Random is faster than SecureRandom, but it uses a 48 bits seeds which is not enough for the long type.Moreover, it is not 'random enough' for cryptography. SecureRandom, is slower than Random, but can be used for cryptography.The following code example shows how to generate a random number within a range for int, long, float and double.Note rangeStart , rangeEnd is range period of generated numbers . int rangeStart = 50; int rangeEnd = 100; SecureRandom secRandom = new SecureRandom(); int inclusive = rangeEnd - rangeStart + 1; int exclusive = rangeEnd - rangeStart; int randomIntInclusive = secRandom.nextInt(inclusive) + rangeStart; int randomIntExclusive = secRandom.nextInt(exclusive) + rangeStart; System.out.println("randomIntInclusive : " + randomIntInclusive); System.out.println("randomIntExclusive : " + randomIntExclusive); long randomLongInclusive = (secRandom.nextLong() % inclusive) + rangeStart; long randomLongExclusive = (secRandom.nextLong() % exclusive) + rangeStart; System.out.println("randomLongInclusive : " + randomLongInclusive); System.out.println("randomLongExclusive : " + randomLongExclusive); float randomFloat = (secRandom.nextFloat() * exclusive) + rangeStart; System.out.println("randomFloat : " + randomFloat); double randomDouble = (secRandom.nextDouble() * exclusive) + rangeStart; System.out.println("randomDouble : " + randomDouble);The output will berandomIntInclusive : 60randomIntExclusive : 73randomLongInclusive : 11randomLongExclusive : 63randomFloat : 65.19333randomDouble : 84.14220368726888Thanks View more...View Test Results in Grafana - Part 2Aggregated on: In the 1st part of this series, we set up Grafana and InfluxDB for our test reports. Now, as a follow up to that, we are going to see how to store test results in database and how to view the results in Grafana. I am going to use Scala with TestNG framework in this demo. For those who are working in Java, it is mostly the same as Scala. View more...Close Resources in JavaAggregated on: In java when using any resources like Files, Streams, Database Connection and DataSets etc .... , you must close resources at end of processing at your code.For Example : Streams File f = new File("myFile.txt"); FileOutputStream fos = null; try { fos = new FileOutputStream(f); // Do something... } catch (FileNotFoundException ex) { // Display error message } finally { // Closing resource if (fos != null) { try { fos.close(); } catch (IOException ex) { //Here , Hide Exception } } }All previous code in Blue color are used to close resources.So to save time and make code more readability you can use IOUtils Appache packages to close resources quietly finally{ IOUtils.closeQuietly(fos); }For Example : Database Statement finally{ DBTransaction txn = this.getDBTransaction(); String sqlStmt = "Begin plsqlCode; END;"; CallableStatement callStmt = txn.createCallableStatement(sqlStmt, DBTransaction.DEFAULT); try { //Write your code here to work with CallableStatement } catch (SQLException e) { //Handle SQL Exception }finally { // Closing resource if (callStmt != null) { try { callStmt .close(); } catch (SQLException ex) { //Here , Hide Exception } } }All previous code in Blue color are used to close resources.So to save time and make code more readability you can use DBUtils Appache packages to close resources quietly finally{ DbUtils.closeQuietly(callStmt ); }Thanks View more...View Test Results in Grafana - Part 1Aggregated on: A good test framework should have a proper reporting mechanism to view and analyze test results. The results should also be sharable. There are many ways to achieve them like test-reports, test execution logs, external plugins. In this article and the next article, we are going to see about a different approach in test reporting. Ever thought of uploading the results into database and view them in a graphical manner in Grafana? Let's see how to achieve this in this series. Grafana Grafana is an open-source tool for data-analytics, view data-metrics, and monitoring apps. Data sources for Grafana can be variety of DataBases like MySQL, Postgres, InfluxDB, Graphite, etc. We are going to use InfluxDB as a data source for our application. View more...Run JavaScript from Native JavaAggregated on: I wrote in previous post Execute Javascript code from Java Code how to execute java script in Oracle ADF.But in this post I will explain how to call Javascript from native Java.The following code snippets will illustrate how to evaluate Javascript code and invoke functions and get return value.import javax.script.Invocable;import javax.script.ScriptEngine;import javax.script.ScriptEngineManager;import javax.script.ScriptException;public class CallJavaScript { public static void callJsCode(String jsCode) throws ScriptException, NoSuchMethodException { // Retrieving the Javascript engine ScriptEngine se = new ScriptEngineManager().getEngineByName("javascript"); try { se.eval(jsCode); } catch (ScriptException e) { e.printStackTrace(); } try { Invocable jsinvoke = (Invocable)se; System.out.println("myFunction(2) returns: " + jsinvoke.invokeFunction("myFunction", 2, 4)); } catch (ScriptException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } }}Then You can call this code using for example try { String jsCode = "function myFunction(x,y){return x+y;}"; CallJavaScript.callJsCode(jsCode); } catch (ScriptException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } The output of previous code will bemyFunction(2) returns: 6.0Thanks View more...Formula to Convert the RSSI Value of the BLE (Bluetooth Low Energy) Beacons to Meters/FeetAggregated on: Due to the pandemic situation because of coronavirus (Covid-19), many developers are working on Bluetooth, NFC, Geolocation, Ultrasound, GPS/GPRS, etc. technologies to implement social distance approach or showing the affected area etc. How to manage social distancing using Bluetooth technology? View more...Iterate Through Java MapAggregated on: There are multiple ways to iterate through a Java Map. Assuming the following map declaration:Map mapObj = new HashMap();//Use Iterator [Generic]Iterator> iter= mapObj.entrySet().iterator();while ( iter.hasNext() ) { Entry item = iterator.next(); System.out.println(item.getKey() + " - " + item.getValue());}//User Iterator [Without Generic]Iterator iter= mapObj.entrySet().iterator();while ( iterator2.hasNext() ) { Entry item = (Entry) iterator.next(); System.out.println(item.getKey() + " - " + item.getValue());}// Use For Each [Generic]for ( Entry item : mapObj.entrySet() ) { System.out.println(item.getKey()+ " - " + item.getValue());}// Use For Each [Without Generic]for ( Entry item : mapObj.entrySet() ) { System.out.println(item.getKey()+ " - " + item.getValue());}//Fetch Value using Keyfor ( String key : mapObj.keySet() ) { System.out.println(key + " - " + mapObj.get(key));}// Loop through Keys onlyfor ( String key : mapObj.keySet() ) { System.out.println(key);}// Loop through Values only for ( Object value : mapObj.values() ) { System.out.println(value);}Thanks View more...ADF : Change View Criteria Columns at RuntimeAggregated on: When creating view criteria related to view object, then all querable attributes are displayed in view criteria by default.So I want to change the properties of this attributes at run time pragmatically to display or hide specific attributes in view criteria.I developed the following method for this purpose, You can add this method to ViewObjectImpl class.I pass attribute name and a Boolean value to determine display in view criteria or no. public void setQuerable(String attributeName, Boolean isQuerable) { int indx = this.getAttributeIndexOf(attributeName); ViewAttributeDefImpl attr = (ViewAttributeDefImpl)this.getAttributeDef(indx); attr.setQueriable(isQuerable); } Thanks View more...Uncommitted data warningAggregated on: If you are working entry data page and some feilds has been changed and you moved to another page, data still in cache but not posted or commited.So to show warning of unsaved data before moving to another page you can do this by setting "Uncommitted data warning" property of af:document to "true". Then whenever user change data and move out of current page or close the browser, it will display a warning of unsaved dataThanks View more...Set Sequence Number by Groovy ExpressionAggregated on: Before I posted how to set Sequence Number using Code Get Sequence Next Value in ADF Today I will illustrate how to set sequence number using groovy language.You can do it by setting default value expression at primary key (new oracle.jbo.server.SequenceImpl("My_seq_name",adf.object.getDBTransaction())).getSequenceNumber()Thanks View more...OAF : Bounce Appache ServerAggregated on: Connect to server using putty and execute the following commands1- Enter commands foldercd $ADMIN_SCRIPTS_HOME2- execute the following commands to stop Apacheadapcctl.sh stopadoacorectl.sh stop3- Execute the following commands to start Apacheadapcctl.sh startadoacorectl.sh start Thanks View more...Compare JBO Date ProgramaticallyAggregated on: To compare two jbo date programatically, l convert jbo date to sql date and then compare sql datesoracle.jbo.domain.Date jboDate1 = new oracle.jbo.domain.Date();oracle.jbo.domain.Date jboDate2 = new oracle.jbo.domain.Date();java.sql.Date sqlDate1 =jboDate1.dateValue();java.sql.Date sqlDate2 =jboDate2.dateValue(); //Compare sql Dateif (sqlDate1.before(sqlDate2 )) { //Write Your Code}Thanks View more...Get All PLSQL ErrorsAggregated on: I developed a function to get all PLSQL errors in schema.This function should be used after calling program units so that can get PLSQL errors and you can use for logging and tracing.Function CodeCREATE OR REPLACE FUNCTION GET_PLSQL_ERROS RETURN VARCHAR2IS LC$RETVALUE VARCHAR2 (4000); CURSOR LCUR$ERRORS IS SELECT DISTINCT NAME, TYPE FROM USER_ERRORS ORDER BY 1, 2; PROCEDURE ADD_LINE (IN_LINE IN VARCHAR2) IS BEGIN LC$RETVALUE := SUBSTR (LC$RETVALUE || IN_LINE || CHR (10), 1, 4000); END ADD_LINE;BEGIN FOR LREC$ERRORS IN LCUR$ERRORS LOOP ADD_LINE (LREC$ERRORS.NAME || ' ' || LREC$ERRORS.TYPE); ADD_LINE ( RPAD ('-', LENGTH (LREC$ERRORS.NAME || LREC$ERRORS.TYPE) + 1, '-')); FOR LREC$ERROR_DET IN ( SELECT LINE, POSITION, SUBSTR (TEXT, 1, 128) TEXT FROM USER_ERRORS WHERE NAME = LREC$ERRORS.NAME AND TYPE = LREC$ERRORS.TYPE ORDER BY SEQUENCE) LOOP ADD_LINE ( LPAD (LREC$ERROR_DET.LINE, 4) || ' ' || LPAD (LREC$ERROR_DET.POSITION, 3) || ' ' || LREC$ERROR_DET.TEXT); END LOOP; ADD_LINE ('*******************' || CHR (10)); END LOOP; IF LENGTH (LC$RETVALUE) = 4000 THEN LC$RETVALUE := SUBSTR (LC$RETVALUE, 1, 3996) || CHR (10) || '...'; END IF; RETURN NVL (LC$RETVALUE, 'No Errors');END;/Function Test SELECT GET_PLSQL_ERROS FROM DUAL; DBMS_OUTPUT.PUT_LINE (GET_PLSQL_ERROS);Thanks View more...OAF : Get Current Row in TableAggregated on: Sometimes you want to get current row in table. To apply this you can use the following code in controller and write it inside processFormRequest method. public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); //Get application Module OAApplicationModule am = pageContext.getApplicationModule(webBean); //Get Row Refrence String rowReference = pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE); //Get current Row using Row Reference OARow currRow = (OARow)am.findRowByRef(rowReference); //Get attribute value from current row String attrValue = (String)currRow.getAttribute("AttrName"); }Thanks View more... |
|
|