JDBC :: Strategy To Process Millions Of Records In Minutes

Dec 9, 2014

Finding a strategy that allow process 12 millions of records in less than 1 hour. Each record can be modified by business rules. In this process are performed insert, update and select in other 3 tables.

The end result of this process is update monetary fields (for the calculations is used BigDecimal) of records in another table.
 
This process is part of the migration of Cobol to Java/Oracle. In cobol this process takes approximately one hour. Is it possible?

View Replies


ADVERTISEMENT

JDBC :: CLOBs - Retrieve Set Of Records Via Ref Cursor

May 21, 2015

I am working on a Java program that calls a stored procedure in an Oracle 11.2g database and retrieves a set of records via a ref cursor. The program follows the standard Connection/CallableStatement/ResultSet pattern. A ResultSet object is used to access and iterate through the returned cursor, processing each record in turn.
 
One of the database fields returned in the cursor is a CLOB, which I'm retrieving using the NClob class's getNClob() method. Two other methods - length() and getSubString() are then used to get the length of the CLOB and copy of it off to a String object respectively.
 
The problem is that these latter two method calls are relatively slow, taking around 80ms to complete for modestly sized CLOBs of, say, around 10KB in size.
 
Is this the most efficient way to access a CLOB and retrieve its contents? If so, is there anything I can do, to make it run faster?

View Replies View Related

Read Amount Of Minutes / Displays Approximate Number Of Years / Days For Minutes

Sep 7, 2014

I need to write a simple program that reads an amount of minutes and displays the approximate number of years and days for the minutes. For simplicity, assume a year has 365 days and the resulting amount of days is a whole number.

View Replies View Related

JSP :: Convert Minutes To Hours And Minutes Using JSTL And Java

Sep 19, 2014

I'm fairly new to JSTL. Can I convert the minutes JSTL expression into hours and minutes using a java method. I'm not sure how to go about.

<% CalendarUtilities.getHoursAndMinutes(%> ${minutes} <% ) %>

View Replies View Related

JSF :: Strategy For Converting HTML Mockups

Sep 30, 2014

This is a summary of our front-end development process:

- designers create PNG mockups
- UXers create HTML mockups
- developers create final JSF

Now, these HTML mockups are pretty complete. They use all our in-house JavaScript widgets, production CSS files, responsive design, accesibility requirements, SEO-friendly code, proper semantics etc. So basically the final HTML we need from the JSFs has to nail these mockups, otherwise widgets might not work, styles might not appear correctly, accesibility errors might crop in and SEO might suffer. The developers tend to have limited experience in HTML/JavaScript/CSS/accesibility, especially compared to the UXers, so the less they can do to screw up the HTML the better.

View Replies View Related

JDBC :: How To Call Parameterized Stored Procedure In Jdbc

May 17, 2014

calling a parameterized stored procedure in java jdbc from sql server.The stored procedure goes like this in sql

create proc patientreg
@id int
as
begin
select [patient_id],[Psurname], [pFirstname], [pMiddlename], [reg_date], [DOB], [Sex], [Phone_num], [Addr],[Email],[dbo].[fncomputeage](DOB) from [dbo].[Patient_registration] where [patient_id] = @id
end
please note dbo.fncompute(DOB) is a function

To call it in jdbc it goes like this

try{
String str = "{call patientreg(?)}";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbcdbc:GeneralHospit al");
cstmt = con.prepareCall(str);
cstmt.setInt(1, Integer.parseInt(t.getText()));

[code]....

after doing it this way it throwing an exception: Error:java.sql.SQLException: Parameter 1 is not an OUTPUT parameter.

View Replies View Related

Adding Records To A File Then Searching That File For Records

Jan 30, 2015

The assignment is to create a program that accepts entries from a user for 3 variables then saves the data to a file. There are other programs that use the file created. One program displays the non-default records. The next program allows the user to enter the id for the employee and displays the first and last name for that id number. The last program allows the user to enter a first name. It then displays all id numbers and last names for records with that first name.

Given the above situation, I am stuck on creating the first program. I can make the text file and write the information to it. However, when the file is created, a space is placed in between each entry for some reason. I cannot figure out how to get rid of this space so that I can display the appropriate records for the remaining programs. Below is the code and a view of my problem.

import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.*;
import java.io.*;
import static java.nio.file.StandardOpenOption.*;
import java.util.*;
public class WriteEmployeeList {

[Code] .....

The values for nameFormat and lnameFormat are 10 spaces. This is how the book told me to make sure everything is uniform and searchable. The file contents look like this when viewed in notepad.

000, ,
000, ,
000, ,
000, ,
000, ,

123,Justin,Slacum
124,Justin,Jones
125,James,Smithy
126,Jake,Flabernathy
127,John,Panakosfskee
128,SuzetteMae,Ginther

000, ,
000, ,
000, ,
000, ,
000, ,
000, ,
000, ,

View Replies View Related

Strategy To Change File Extension And Read Library

Sep 19, 2014

I need to be able to select a file (compressed), change its file extension (to zip) and load all its content, preferably as objects. If it makes things easier one can assume all these files to be of the same type.

The content of the zip file are placed in folders, known Beforehand which might make things easier.

View Replies View Related

How To Code MMO Real-time Strategy Social Game In Java

Aug 25, 2014

I want to work on a project related to MMO real-time strategy social game as a college project but i dont have enough knowledge on it starting from 3d object coding to server.

Also i would like to know what are things to be cosidered as its an online game whether the camera angel affect what are problems that might occur and how to outrun it. How to split the server so that in one server depending upon the geo-location some number of users will be connected and will be splitted in different servers depending on the location

I want the actions to be cloud based but the actions of the characters will be coded within the game and in every server maximum of 100 users can connect.

Create several rooms.

View Replies View Related

Second Counter To Minutes

Apr 7, 2014

I have a timer where it counts down from 300 to 0 then does something. But I want the display for the clock to show the time in minutes. I tried:

double showTimeLeft = timeLeft / 60;
o.setDisplay(String.format("%.2f", showTimeLeft) + " Minutes");

But Every so many seconds it skips like:

Time = 3.38
Time = 3.37
Time = 3.35
Time = 3.34

It skipped 3.56

How to do this right?

View Replies View Related

Changing Hour To Minutes?

May 1, 2014

I have a servlet with a method:

/**

* @return <code>double</code> Hours
*/
public double getDriveHours() {
return getAsDouble("DriveTime", 0.0D);
}

I would like to change the time to minutes. I will create a new entry in the db for the minutes, but wondered if the time minutes is also double.

View Replies View Related

EJB / EE :: Gateway Timeout After 5 Minutes Websphere 8.0

Mar 10, 2014

I have a web application where the server has to write the excel document to the output stream.It takes more than 5 minutes for the server to write it.After 5 minutes i get a '504 gateway timeout' error code. I have tried setting the timeout values in the web container in Admin Console.Still the same problem.I followed this link.

[URL] ....

I even tried setting the ConnectionKeepAliveTimeout and ConnectionIOTimeOut values. But still didn't work. How do i increase the timeout value?

View Replies View Related

Countdown Timer - Minutes Class

Dec 10, 2014

I have this code for a Countdown Timer...

Java Code:

package javaproject;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import Countdown.Timer;
import java.util.Timer;
import javaproject.Countdown;
public class Minutes {

[Code] ....

Do I need to put more code in the Countdown class or in the Minutes Class...

View Replies View Related

Java Minutes Program - Countdown Timer

Dec 1, 2014

I'm trying to put in a countdown timer into my project, but want to get it working first. I am finding trouble because I have a couple of errors.

Java Code:

package Project;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Minutes {
int count = 30; //Integer count is set equal to 30.
int delay = 1000; // Integer delay is equal to 1000. 1000 being in milliseconds which is 1 second.

[Code] .....

View Replies View Related

Simulate Press Of Space Button Every 15 Minutes

Jul 1, 2014

I'm on windows 8 and I want to use notepad or notepad++ to simulate the press of the space bar every 15 minutes so my computer doesn't auto lock.

View Replies View Related

Java Server Disconnects Inactive Users After 5 Minutes

May 19, 2014

I'm using this methodology for Java connection between client and server, the server allows the user to stay connected while it is sending messages, but if you stay an average time of 5 minutes without send anything it is disconnected, I need to increase that time to about 30 minutes or disable this disconnection for inactivity.

Settings:
Netbeans 8.0
Windows Seven 64 Bits Ultimante

The following code:

package redes;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;

[Code] .....

View Replies View Related

Java Server Disconnects Inactive Users After 5 Minutes

May 19, 2014

I'm using this methodology for Java connection between client and server, I copied it from the internet, but the server allows the user to stay connected while it is sending messages, but if you stay an average time of 5 minutes without send anything it is disconnected, I need to increase that time to about 30 minutes or disable this disconnection for inactivity.

Settings:
Netbeans 8.0
Windows Seven 64 Bits Ultimante

The following code:

package redes;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.PrintWriter;
import java.net.Socket;

[Code] ....

View Replies View Related

Time Comparison - Converting To Seconds / Minutes And Hours

Apr 27, 2013

I want to compare two times. What I am doing is

java.util.Date date = new java.util.Date();
java.sql.Time cur_time = new java.sql.Time(date.getTime());

/*this is my database connectivity code from where I am getting second date that I am comparing. This is right. Don't bother it.

Connection c= ConnectionManager.getConnection();
String sql = "select t from datesheet where subjectCode=? and sessional=? and d=?";
PreparedStatement ps = c.prepareStatement(sql);
ps.setString(1,subjectCode);
ps.setString(2,sessional);
ps.setDate(3,cur_date);
ResultSet rs = ps.executeQuery();*/
if(rs.next())
{
java.sql.Time t = rs.getTime("t");
long diff = cur_time.getTime()-t.getTime();
}

Then I am converting it to seconds, minutes and hours, but the problem is time that we get from cur_time.getTime() has more digits than time that we get from t.getTime(), so it is always greater than t.getTime() even when it is not.

long seconds = (diff/1000)%60;
long minutes = (diff/60000)%60;
long hours = (diff/(60*60*1000))%24;

View Replies View Related

Creating TravelTimeRow Inside A Class With Strings For Time - Hours And Minutes

May 13, 2014

I have an application which is doing a fine job of placing the total hours on the interface.

Where I am breaking down is that I am unable to split the string into two distinct groups: hours and minutes

private HtmlElement createTravelTimeRow(ShowSet showSet) {
HtmlElement tr = new HtmlElement(ROW_OPEN, ROW_CLOSE);
HtmlElement td = new HtmlElement(CELL_OPEN, CELL_CLOSE);

[Code].....

I came across something which showed how to split the String but I am still very unsure how to do this.

View Replies View Related

Swing/AWT/SWT :: Adding Records Using AbastractTableModel?

Feb 2, 2014

I'm starting to use AbstractTableModel to customize a JTable model. The problem appears when you add a record from a ResultSet to JTable object.

I've managed to insert records, but empty, I need that for every column I can see the data is there.

Leave some code I have been writing ... the method to insert records in JTable is called "insertEmptyRow" (for now).

I need some opinion that can make changes to the code of this method so you can get to see all the data in a record.

MyFirstModel:

public class TablaModeloPrincipal extends
private String algo;
private int numRegTabla;
//Agrego las columnas que quier tener en el model
private String[] columnNames = {"DNI", "Nombre", "Edad", "Dirección", "Empresa", "Contacto"};
Vector<String[]> clientes = new Vector<String[]>() ;
public ResultSet buscarResultset() throws SQLException{
ResultSet rs=null;

[code]....

View Replies View Related

Sending XML Records To Sax Parser Using Buffer

Mar 26, 2014

i am having a below piece of code in my worker thread. In my output i am getting xml records from the database. I'm sending this output to a input stream & finally to a sax parser.My query is, before sending to the parser i need to store the input stream in buffer. The buffer should store 1000 records. For every 1000 records the parser should be called from buffer.

while (orset.next()) {
output = orset.getString("xmlrecord");
writeCount++;
InputStream in = new ByteArrayInputStream(output.getBytes("UTF-8"));
InputStream inputStream = new ByteArrayInputStream(output.getBytes("UTF-8"));
Reader reader = new InputStreamReader(inputStream,"UTF-8");

[code]....

View Replies View Related

Reload Array With Records In A File

Apr 19, 2014

I am working on a project and for one step, I need to load an array (which in this case, students[]), with the records in another file.

So, should I used the try, catch method?? I am just not sure about the array. I know how to read from a file, but, I didn't get the idea of loading an array.

View Replies View Related

HashTable Insertion - Duplicate Records

Apr 20, 2015

I am having some difficulty adding a new item to the HashTable when a collision occurs. We can only use the basic utilities to code this, so we are coding a HashTable by hand. We have an array of length of 10, which each index holds or will hold a Node for a Linked List.

The code hashes fine, adds the item, but the problem exists when adding items that already been hashed. The project is much bigger, but this is the engine behind the rest, and I figured I would tackle this first.

The items we are adding are objects which are states containing different information, we hash based on the ASCII sum % tableSize.

Here is the code I am testing with to add items:

HashTable ht = new HashTable(10);
State az = new State("Arizona","AZ","W",2,"Y",2);
State fl = new State("Florida", "FL", "F", 2, "X", 2);
State hi = new State("Hawaii", "HI", "H", 3, "Z", 1);
State al = new State("Alabama", "AL", "A", 5, "W", 0);
ht.insert(hi);

[Code] ....

View Replies View Related

Servlets :: Access List Of Database Records Using JSP?

Apr 3, 2014

How we can get the list of records from database my sql using jsp pages and servlets so that it show results on webpage.

View Replies View Related

Write Multiple Records To A File - Why Does This Keep Overwriting

Oct 27, 2014

So I am calling this method several times and trying to write multiple records to a file. Problem is that every time I call the method it overwrites the file from before and doesn't add it.

public void fileWriterMethod() throws IOException{
RandomAccessFile raf = new RandomAccessFile(filename, "rw");
raf.writeInt(id);
raf.writeInt(existingMileage);
raf.writeInt(gasCost);
raf.writeInt(ndays);
raf.writeInt(rate);

[Code] ....

View Replies View Related

Reading Records From TXT File And Storing It Into Array

Apr 15, 2014

I am reading records from a txt file and storing it into an array

import java.util.*;
import java.io.*;
 public class PatientExercise {
//patients exercise time
public static void main (String[]args) throws IOException{
Scanner in = new Scanner(new FileReader("values.txt"));
double [] patientTimeRecords = new double [300];
int noExerciseCount=0, numPatients =0;
double highest=0, lowest=0, avg=0, totalTime=0;
 
[Code] ....

However an error msg keeps popping up:

Exception in thread "main" java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:907)
at java.util.Scanner.next(Scanner.java:1530)
at java.util.Scanner.nextDouble(Scanner.java:2456)
at pastpapers.PatientExercise.main(PatientExercise.ja va:44)

line 44 is:patientTimeRecords[i]= in.nextDouble();

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved