Skip to main content

Posts

Showing posts from 2017

Converting excel data into SQL insert query.

Lets suppose you have thousands of data which you need to insert in database and that data is in Excel. you can easily convert your data into query. 1. insert a new column in your sheet. 2. write this query in the first empty column which is newly created  here B2,C2 represent columns of your data. Query builder: = "insert into employees values('" &B2& "','" &C2& "','" &D2& "','" &E2& "','" &F2& "', '" &G2& "','" &H2& "','" &I2& "','" &J2& "','" &K2& "','" &L2& "','" &M2& "');" 3. Add coloumns which you need in your query. 4. drag down to all rows so that changes reflect for all the rows. 5. save your excel. you have sql query of insertion.

SQL Error: ORA-14402: updating partition key column would cause a partition change

Error: SQL Error: ORA- 14402 : updating partition key column would cause a partition change 14402 . 00000 - "updating partition key column would cause a partition change" *Cause: An UPDATE statement attempted to change the value of a partition key column causing migration of the row to another partition *Action: Do not attempt to update a partition key column or make sure that the new partition key is within the range containing the old Solution :  ALTER TABLE <table name> ENABLE ROW MOVEMENT; Example: select * from part_table; CREATE TABLE part_table (ID NUMBER ) PARTITION BY RANGE (ID) (partition p0 values less than ( 1 ), PARTITION p1 VALUES LESS THAN ( MAXVALUE )); insert into part_table values ( 0 ); UPDATE part_table SET ID = 2 ; when you try to update this partition column it gives you  ORA- 14402 . By default ROW MOVEMENT is DISABLE. you should al...

java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()

Exception: java. lang . NoSuchMethodError : javax. ws . rs . core . Application . getProperties ()Ljava/util/Map; at org. glassfish . jersey . server . ApplicationHandler .<init>(ApplicationHandler. java : 304 ) at org. glassfish . jersey . server . ApplicationHandler .<init>(ApplicationHandler. java : 285 ) at org. glassfish . jersey . servlet . WebComponent .<init>(WebComponent. java : 311 ) at org. glassfish . jersey . servlet . ServletContainer . init (ServletContainer. java : 170 ) at org. glassfish . jersey . servlet . ServletContainer . init (ServletContainer. java : 358 ) at javax. servlet . GenericServlet . init (GenericServlet. java : 158 ) at org. apache . catalina . core . StandardWrapper . initServlet (StandardWrapper. java : 1231 ) at org. apache . catalina . core . StandardWrapper . loadServlet (StandardWrapper. java : 1144 ) at org. apache . catalina . core . StandardWrapper . load (StandardWrapper. java : 1031...

Failed to instantiate [org.apache.cxf.endpoint.Server]: Factory method 'jaxRsServer' threw exception;

Exception: Caused by: org. springframework . beans . BeanInstantiationException : Failed to instantiate [org. apache . cxf . endpoint . Server ]: Factory method ' jaxRsServer ' threw exception; nested exception is java. lang . NoSuchMethodError : org. springframework . aop . support . AopUtils . isCglibProxyClass (Ljava/lang/Class;)Z at org. springframework . beans . factory . support . SimpleInstantiationStrategy . instantiate (SimpleInstantiationStrategy. java : 189 ) at org. springframework . beans . factory . support . ConstructorResolver . instantiateUsingFactoryMethod (ConstructorResolver. java : 588 ) ... 28 more Caused by: java. lang . NoSuchMethodError : org. springframework . aop . support . AopUtils . isCglibProxyClass (Ljava/lang/Class;)Z at org. apache . cxf . common . util . SpringAopClassHelper . getRealClassInternal (SpringAopClassHelper. java : 85 ) at org. apache . cxf . common . util . ClassHelper . getRealClass (ClassHelper. java : 55 ) at or...

Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.

I was hitting the same problem when working with Apache tomcat . . Solution Steps : Backup your pom.xml somewhere. Go to your pom.xml and on the bottom tab and click "Dependency Hierarchy" tab.  From there search for log4j-over-slf4j.  Exclude all instances of this dependency (right click on the instance and "Exclude Maven Artifact"). After you have no more log4j-over-slf4j appearing save your POM and try to run the program.  If it still doesn't work then undo the changes you just made and exclude all instances of slf4j-log4j12. Hopes this will resolve your problem

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;

Problem : Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String; Solution : getContextPath() was added with Servlet 2.5, does your version of Jetty supports that ?  Might also want to check that you do not have some older or duplicate version of j2ee around. Indicates that Jetty 6.1.x supports Servlet 2.5 , make sure you don't have a pre-2.5 servlet version around. If this gets loaded before the 2.5 version, the entire classpath sees only Servlet 2.0 API (the 2.5 doesn't even gets loaded). so exclude it from the maven pom.xml Exclusion entry <exclusion> <artifactId> servlet-api </artifactId> <groupId> javax.servlet </groupId> </exclusion>

Debug javascript.

Guide to Debug your java script files in google Chrome. Ways to find debug console in chrome. 1. install FirebugLite : https://chrome.google.com/webstore/detail/bmagokdooijbeehmkpknfglimnifench/https%3A//chrome.google.com/webstore/detail/elkkomimknapgodalnkjeddkjnjkfmfp 2. press F12 or inspect element Below window will open up which contains various tabs.   Tab Details: Elements: it shows HTML part of your page. console : in case you want to run some statements. sources : all your JavaScript files. Network : shows all your Ajax and load requests. Performance: you can monitor your page performance How to debug: To debug any javascript file just search your file by using ctrl+O or select your file from the left panel of your browser window. To add debug point just click on row number as shown in the image below. Now perform any operations on you webpage. Here I'm selecting value from the dropdown. As soon as you sel...

HTTP Status 405 – HTTP method GET is not supported by this URL

Problem : HTTP Status 405 - HTTP method GET is not supported by this URL Solution : This is always caused by following two reasons 1) You do not have a valid doGet() method, when you type the servlet’s path in address bar directly, the web container like Tomcat will try to invoke the doGet() method. public void doGet (HttpServletRequest request, HttpServletResponse response) throws IOException{ } 2) You made a HTTP post request from a HTML form, but you do not have a doPost() method to handle it. The doGet() cannot handle the “Post” request. public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException{ } Example of wrong doGet() and doPost() method protected void doPost (HttpServletRequest request, HttpServletResponse response, PrintWriter Out){ } These two methods get() and post() must have only 2 parameters otherwise it will not be called.

Display data from Json in Angularjs

Problem : I'm using the following code, witch includes the app.js, page.html and data.json The app.js seems to work fine, but the view (page.html) isn't display any data.. HTML : <div ng-controller= "tablesController" style= "padding-left: 15px" > <div class= "ng-scope" > <div class= "row ng-scope" ></div> </div> </div> <div> <md -list flex > <md -list-item class= "md-3-line" ng-repeat= "item in hotelList" ng-click= "null" > <img ng-src= "{{item.hotel_data_node.img_selected.thumb.l}}?{{$index}}" class= "md-avatar" alt= "" /> <div class= "md-list-item-text" layout= "column" > <h3> {{item.hotel_data_node.name}} </h3> Rating : <h4> {{item.hotel_data_node.extra.gir_data.hotel_rating}} </h4> </div> < /md...

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA Solution : Try changing your ORA properties. from this : ORA11gR23 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = orasrv-alanb-lx06) (PORT = 1521 ) ) (CONNECT_DATA = ( SERVER = DEDICATED) (SERVICE_NAME = ORA11gR23) ) ) )    To this: ORA11gR23 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = orasrv-alanb-lx06) (PORT = 1521 ) ) (CONNECT_DATA = ( SERVER = DEDICATED) (SERVICE_NAME = ORA11gR23) ) )    your SERVICE_NAME = ORA11gR23 should match the name you have given before description.

Unknown Provider : $locationProviderProvider <- $locationProvider

Error : Unknown Provider : $locationProviderProvider <- $locationProvider <- myCtrl  also got this error. You're allowed to inject a $location into a controller, but not a $locationProvider. Instead, the $locationProvider can be injected into a config method: Solution : var app = angular.module( "myApp" , []); app.config( function ($locationProvider) { $locationProvider.html5Mode( true ); }); app.controller( "myCtrl" , function ($location) { $location.path( "/some/path" ); }); And since I made this additional mistake: it's not just that you should add an app.config bit, but also remember to remove $locationProvider from the controller arguments, or you'll keep getting this error. Also you have to add <base> tag in your html file <head> tag <base href= "/myDemoProject/" >

Angular alert will not display after being closed

Problem : when you try to close the angular success and error pop up using manullay or using alert('close') event. HTML <div class= "cacheSuccessMessage alert alert-success alert-dismissable-success" > <span class= "cacheMessageHeader" ><strong></strong></span> <div class= "cacheMessageDetails" ></div> </div> JS: $( ".alert-dismissable-success" ).fadeTo( 4000 , 500 ).slideUp( 500 , function () { $( ".alert-dismissable-success" ).alert( 'close' ); }) so when you fire event of close Data-dismiss completely removes the element.  Solution :   Use jQuery's .hide() or angular hide method instead to hide error. and modify you HTML and JS as  HTML <div class= "cacheSuccessMessage alert alert-success" > <span class= "cacheMessageHeader" ></span> <...

Tail Logger for Big .log files - Log Expert

While development you might encountered problem of logging big files for logging every time we have to either load  .log file in notepad on in any other software. here is a software which smartly handle all your log files and it follows the tail Summary of features: Tail mode MDI-Interface with Tabs Search function (including RegEx) Bookmarks A very flexible filter view Highlighting lines via search criteria Columnizers: This means splitting log lines into columns for some well defined logfile formats Unicode support log4j XML file support 3rd party plugin support SFTP support (loading files directly from SFTP) Plugin API for more log file data sources You can download it from here. http://logexpert.codeplex.com/