473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Sql Server table stored in a searchable java table?

ck9663
2,878 Expert 2GB
I have a table on sql server (~40K rows). I need the content of this table be stored in some sort of table in java that I can search on so that I don't need to keep on running a select on the sql-server.

Running a query to do a select on this table is fast, but am running a 15M rows text file against it, so it's affecting the performance.

Thanks guys.

-- CK
May 27 '08 #1
7 1714
BigDaddyLH
1,216 Expert 1GB
Check out JavaDB: http://developers.sun.com/javadb/index.jsp

It is a 100% Java database that can be run as a separate server process or embedded in your application. I'm thinking you could copy data from your external database into an embedded database and then take it from there.
May 27 '08 #2
ck9663
2,878 Expert 2GB
Thanks. I'll check this out.

-- CK
May 27 '08 #3
ck9663
2,878 Expert 2GB
There's a problem, Derby can only be access by one application at a time. The java script that I is being controlled by a scheduler. It will monitor a folder if a new file is dropped on that folder and will start a job. Since the execution time of each job varies depending on the file size, there's a probability that two job could run simultaneously.

I'm thinking of just creating a simple table in java and populate it with data form sql server table. Will array be efficient enough for this? Table size = 40K rows.

Thanks

-- CK
May 28 '08 #4
BigDaddyLH
1,216 Expert 1GB
There's a problem, Derby can only be access by one application at a time. The java script that I is being controlled by a scheduler. It will monitor a folder if a new file is dropped on that folder and will start a job. Since the execution time of each job varies depending on the file size, there's a probability that two job could run simultaneously.

I'm thinking of just creating a simple table in java and populate it with data form sql server table. Will array be efficient enough for this? Table size = 40K rows.
First, by "Java script" you mean "Java program", not "Javascript", right?

As for the probability of running two instances of the application at the same time, if you want to avoid that, there is a standard way to detect if a program is already running: have the program first acquire a server socket at a determined port. If it can't acquire this server socket, it's a sign that the program is already running.

Finally, an array or java.util.List of length 40K is not large.
May 28 '08 #5
JosAH
11,448 Expert 8TB
There's a problem, Derby can only be access by one application at a time.
That's only true for the 'embedded driver'; the other one (I can't find its name
right now in my mess) allows multiple connections from multiple applications
to its database; but the reading of the text file is probably much much slower
than the data retrieval from the database.

kind regards,

Jos
May 28 '08 #6
ck9663
2,878 Expert 2GB
Yes, I mean Java, sorry.

Yes, I missed that part on the documentation. It says server framework allows multiple connections. I think that's what I need. I'll try array first.

The java code that I am running grabs the lookup table on the first part of the code. Then it will read every record on the file (15M records). From this record, I need to check 20-30 fields if it's existing on the look table. However, the third-party app I'm using does not allow me to create a single function to do this. I end up creating 30 function to search the 30 fields (one for each). I know, tell me about it.That's a limitation that they're still working on. Until they fix it, am stuck with this.

So the function will read this array 30 times x 15M rows.

Between the options of reading an array 30 times per row and connecting to Derby 30 times per row would you suggest using Derby or array?

Array size would be 40K rows x 10 columns.

Thanks

-- CK
May 28 '08 #7
BigDaddyLH
1,216 Expert 1GB
Rather than guessing I'd whip up some code and time it.
May 28 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Alexander DEJANOVSKI | last post by:
JyRetic 1.0RC3 was just released. (http://retic.sourceforge.net) Changes are (I might have forgotten some bug fixes): - Bug fix : Scheduled events didn't work if no parameter file was required...
13
by: Jeager | last post by:
Why is it, Microsoft manage to write operating systems and office applications with every bell and whistle facility known to man. Yet, even after years and years of development they still cannot...
11
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures...
5
by: Rich Hall | last post by:
Can somebody tell me how Stored Functions are kept in the database? I've gone through the catalog several times. I've found many interesting things but NOT the 300-odd functions I've created. ...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
3
by: jynxxxed | last post by:
I've been reviewing some of the threads here and applying some of the advice and still getting the same error. 15:50:26,935 INFO java.sql.SQLException: Could not find stored procedure...
1
by: jynxxxed | last post by:
I've been reviewing some of the threads here and applying some of the advice and still getting the same error. 15:50:26,935 INFO java.sql.SQLException: Could not find stored procedure...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.