This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Patryk Sosinski

Greenhorn
+ Follow
since Sep 10, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Patryk Sosinski

Daniel Val wrote:

Otherwise, your only approach would be to serialize your data in some folder and then load it from there.




Yep, or store data in XML file (easy import, export, transfer etc.).
Put this code in line 58 (or use any other debugger to check this). Is it true or false?
And show the code of session.connection() method.

kri shan wrote:

It is not always returning the latest last_load_time. Can i query any other table ?



Are you sure? It does not return the latest, so is it missing a record with latest log? Did you sorted the results?


I have just checked in my local db and it seems to be working properly

vdammala vkumar wrote:Guys - i want to make it dynamic , current system is having static params as suggested by Patryk , i have to replace them with the query params using '?'(or any other way).

-So basically i never know what are the fields i need to retrieve from Table in compile time, it may change from job to job.



It is dynamic. You dont really have to know the column_name parameter. You can pass diferent column_name in each iteration of a loop. Assume You got table with all column_names called column_list_table, you could write something like this (pseudocode):

Hi, try:



there are columns: FIRST_LOAD_TIME, ELAPSED_TIME and LAST_LOAD_TIME

vdammala vkumar wrote:thanks for your response patryk, i am getting the below error :
java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specification

however I am looking for some workaround for this problem.



If You are using java it is quite simple. If You got column name as String just create query String and use it to create PreparedStatement.


I think you cannot set table name as parameter in PreparedStatement.

Edit: Sorry i read Your question wrong. Still you cannot set column name as parameter in PreparedStatement
As far as i remember You cannot embed external jars inside output jar. The solution to this are:
1. include required jars when starting application like: java -jar app.jar -cp libs/*.* (where in lib folder are all external jars)
2. Use some application to merge the compiled classess inside jars into one jar, for example http://one-jar.sourceforge.net/

Ah, sorry. You have to use convert function but i cant write more - dont have MS SQL installed.
Check this out:
http://www.sqlusa.com/bestpractices/datetimeconversion/
Use to_date() function:

create table test (id number primary key, d date);

insert into test values (1, to_date('01-03-2012', 'DD-MM-YYYY'));
Easiest way, make the column in the database unique and then just handle error, or during form validation you can execute for example:

If the value is more than 0 then record with provided emailID is already in database.
There are more efficient queries than above but i dont know what kind of database are you using. Still i am not sure if it is what you asked, as your question is really difficult to understand.
You got ServletException so it is some kind of web application (maybe you got embedded tomcat server in eclipse). It is normal that when you run standalone java class all jars are taken from classpath, but when you deploy application to servlet container you need to put those jars in for example WEB-INF/lib directory as they are not deployed.
Maybe ports in firewall are not opened. Try to telnet ip port. If you cant telnet propably firewall is blocking.

Jan Cumps wrote:
Vicky is using the thin driver. That doesn't use TNS.



True, but connection to sqlplus use TNS (i think), so tnsping maybe give some direction what is wrong (maybe different ip is assigned in TNS and different in etc/hosts)