This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://abc.com/seek/comet-binary/update?stream.body={%22delete%22:{%22query%22:%22text:\%22503%20Service%20Temporarily%20Unavailable\%22%22}}&commit=true | |
http://abc.com/seek/comet-binary/update?stream.body={"delete":{"query":"*:*"}}&commit=true | |
http://abc.com/seek/comet-binary/update?stream.body={"delete":{"query":"text:\"503 Service Temporarily\""}}&commit=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* http://stackoverflow.com/questions/1062113/fastest-way-to-write-huge-data-in-text-file-java | |
* | |
* I have to write huge data in text[csv] file. I used BufferedWriter to write the data and it | |
* took around 40 secs to write 174 mb of data. Is this the fastest speed java can offer? | |
* bufferedWriter = new BufferedWriter ( new FileWriter ( "fileName.csv" ) ); | |
* | |
* You might try removing the BufferedWriter and just using the FileWriter directly. On a modern system | |
* there's a good chance you're just writing to the drive's cache memory anyway. | |
* It takes me in the range of 4-5 seconds to write 175MB (4 million strings) -- this is on a dual-core 2.4GHz Dell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SysOutToFile { | |
public void test() { | |
String line = System.getProperty("line.separator"); | |
PrintStream out = new PrintStream(new FileOutputStream("C:/migration-out.txt")); | |
PrintStream err = new PrintStream(new FileOutputStream("C:/migration-err.txt")); | |
System.setOut(out); | |
System.setErr(err); | |
out.flush(); | |
err.flush(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestThread { | |
public static void main(String[] args) { | |
String[] workitems = {"Quran", "Coummnity Service", "Teaching", "Business"}; | |
for (String name : workitems) { | |
new Thread(new DoWork(name)).start(); | |
} | |
System.out.println("Done...."); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.Pattern; | |
import org.apache.commons.lang.StringUtils; | |
public class StringUtil { | |
private static final Pattern REGEX_PATTERN = Pattern.compile("[^\\p{ASCII}]+"); | |
public static String stripNonAsciiChars(String input, String repalceCharWith) { | |
return (StringUtils.isBlank(input)) ? null : | |
REGEX_PATTERN.matcher(input).replaceAll(repalceCharWith); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merge into tims_idr_agent t | |
using (select 1 from DUAL) s | |
on (t.id = p_id AND t.audit_cycle = p_audit_cycle) | |
when matched then | |
update set t.name = 'Alan1',t.phone = '-2932x',t.email = 'Alan@v1',t.category = 'Domestic1' | |
when not matched THEN | |
INSERT (audit_cycle,ID,NAME,phone,email,category) | |
VALUES(p_audit_cycle,p_id,p_name,p_phone,p_email,p_category); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- insertion and retrieval of the unique id is done in two steps(two db calls) if you were to implement using java approach. this can be simplied if you were to implement it in stored procedure. | |
- Maintenance of any structural changes are always easier at oracle/db end when compared to doing it at java end | |
- code is much cleaner if done at db end rather than doing it at java end | |
- perfect use case which is in favor of keeping the save logic at the DB end is | |
Multiple saves in One Single page | |
Project -> Project | |
Project -> ProjectBusiness | |
Project -> businesses | |
Project -> country |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
String filename = "/sanvol/app/folder1"; | |
out.println(filename); | |
java.io.File f = new java.io.File(filename); | |
out.println(f.isDirectory()); | |
javax.naming.InitialContext ic = new javax.naming.InitialContext(); | |
javax.sql.DataSource ds = (javax.sql.DataSource) ic.lookup("java:oasDS"); | |
out.println(ds); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec dbms_stats.gather_table_stats (ownname => 'abcDBA01',tabname => 't_table_name',estimate_percent=> 100,cascade => true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create index i4_mvtable on mvtable(c1||c2||c3, c4, c3); | |
create index i5_mvtable on mvtable(c1, c4, c3); | |