sinasi susam

Ranch Hand
+ Follow
since Jul 15, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sinasi susam

Firstly i just did not understand your question very much...

1- you want to take a back up of mysql db and later you wanna insert all into db right?

2- My sql is storing db as files somewhere in its folders.
If your aim is only for back up then why don't you copy the files to somewhere and later copy the files to the mysql's folder that it uses from, as db? I mean manually...

As i said i had a couple questions, I was not sure about what you mentioned exactually.

If in any case you wanna store the datas to files (programatically) and later you wanna insert them into mysql again,

You can use serialization.

You create a javabean which will hold the data .
you persist data with that java bean into disc.
And you can retrieve it later too.

gl
[ September 23, 2006: Message edited by: sinasi susam ]
Alright MB, i might have been in habit of writing it.Because of using periodically here ,in daily life.

Thank you
Why do you still need another object while ResultSet is doing the same thing for you?

set the fetch size of ResultSet to 100 and show whenever ,whatever you want..

ResultSets takes data from db at amount of fetch size.When came to the end of the fetch It goes to db and fetcs another 100 of data.
Why It doesnt take all datas?

Thats because the memory would not be enough for that...Otherwise, They (SUN) would have given that skill(fetch all at once) to ResultSet too.

Lets think like this ; Lets say you have a RAM of 500 KB and you selected something from db (in any language, not only with jdbc),and lets say that table with huge amounth of data contains 1GB data in the disc.How do you think to grab it to RAM? its 500 KB?

Vector, Arraylist or No Collection can afford it.

nice day.
It says;

ResultSet.TYPE_SCROLL_INSENSITIVE

I think that should be

ResultSet.TYPE_SCROLL_SENSITIVE
Anybody did'nt have any opinion?

Any experience about this?

Do i have to set some more things to achieve that?
You can not show all datas at once.And from my point of view its no sense eighter.
Will the user check each of datas of 50 millions? No.

Paging may help you.
Show results page by page.and put links for pages at bottom.when user clicks a page link then show next pages.

you may need a session scope javabean to store the resultset.

good luck.
I created an updateable and scrollable Resultset for Oracle database.
I can update a specific column and scroll down and up too.
I can insert a row in insert row too.

If i commit (its setted to autocommiting to false) the connection then it places the row to table too.

But The problem is ;
for some reason i can't see the inserted row when i scrolled back to the first row and print the rows in a loop.

Here is how i am tring to do that ,


Is there something wrong with my code ?
Its thin driver.Or something wrong with my driver?

Thank you.
[ September 12, 2006: Message edited by: sinasi susam ]
"You never pass the object. All objects are stored on the heap. Always."

I was reading "camp fire stories" .
The quote was cut from "pass by value" article.

All objects have a reference on the heap (a number).So how are primitive values stored in ram?

I put a primitive value to a method and its not changing the value when its pair changed inside the method.If i put an object into a method the outter object is affected.Why was not primitive affected?

I have read "pass by value" article.I did not understand anything.
Author was tring to tell something with cups.But understanding the cups example never means understanding how the primitives work.

One more , is String an object or primitive?
[ September 02, 2006: Message edited by: sinasi susam ]
17 years ago
If you are using one statement instance for all Threads ,whenever you execute the statement, you close automatically the previous ResultSet which it holds on it.Because a statment instance can hold only one ResultSet.
Reexecuting same statement will interrupt (close) the previous resultset.
[ July 01, 2006: Message edited by: sinasi susam ]
17 years ago
" because it seems like that result set is gonna take a lot of memory, but I'm wondering if I might be able to do something in addition to speed up the process."

Why do you think so?

ResultSet doesn't bring all datas at once.It stores with fetch size amount of data.aAd with every next() it takes one from fetched datas.If it comes to the end of the fetch,then it goes to db and fetches next.

Good news is that you dont have to worry about the memory usage

Bad news is ResultSet doesnt know how many records the sql brought.Because of its nature i told you above.
Therefore you can not know how many rows brought.
[ June 05, 2006: Message edited by: sinasi susam ]
"String classname = "com.whatever.strategies.StrategyFor" + product;
Strategy = Class.forName( className ).newInstance();
"

why? is this something more different than refl?

why mustn't we?
17 years ago
I am tring to refresh a Connection without closing it phsically from db.
We are using a simple connection pool(hand-made ,and not mine )
How can i do that with out creating a new connection?

I googled for it in the net and in this site ;

http://www.lc.leidenuniv.nl/awcourse/oracle/java.920/a96654/connpoca.htm#1057365

They say ;

"Closing a connection instance that was obtained from a pooled connection does not close the physical database connection. It does, however, free the resources of the connection instance, clear the state, close statement objects created from the connection instance, and restore the defaults for the next connection instance that will be created."

When i saw that i felt so happy then.

But at the next paragraph says;

"To actually close the physical connection, you must invoke the close() method of the pooled connection..."


I am confused.

How can i refresh a connection resources without reopening a new Connection to db?

Thank you.
[ June 01, 2006: Message edited by: sinasi susam ]
hi all,
suppose that all codes in if statements are in different methods.

How about using reflection to invoke different methods instead if stattements in Runtime?

for example ;


good luck.
17 years ago
Dear Friend (me mr)

Its posible to use a FileFilter to list Files



And its interesting if those methods worked only for C\ drive.

I havent experienced something like that.
Thats all i have
[ May 25, 2006: Message edited by: sinasi susam ]
17 years ago
dear friend ,

you can use the exist() method of the File class in order to determine wheter its existing or not.

And if you want to know a File instance was a File or a Folder

you can use isFile() and isDirectory() methods of the file class.

good luck.
17 years ago