Kilia Verdon

Greenhorn
+ Follow
since Jan 20, 2008
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 Kilia Verdon

Hello everybody,

I am not sure if my posting is in the right subforum, but I hope so.

My question:

I wrote a short .bat file to run a task:
C:\SQLTask.bat

"C:\Programme\Microsoft SQL Server\90\Tools\Binn\SQLCMD.Exe" -i "C:\code.sql"
pause



This bat-file runs an sql file without opening microsoft sql management studio. If I run the file a dos-window is beeing opened and displays an sql report (how many lines have been affected and so on).

Now I would like to run this bat-file out of a java program. I used:
Runtime.getRuntime().exec("C:\\SQLTask.bat");

Unfortunately no DOS Window is beeing displayed (and I need the report of the sql server).

How do I have to change my code in order to run the bat-file out of my java tool and to open a dos window, which displays the report ?

I tried with Start "C:\Programme.... -> but I dont know how to set the quotes. it does not work

It would be very nice if someone could help me.

Thanks a lot
15 years ago
hello Jeanne

thanks for your answer.
yes i am allowed to do any operation on the server because it is running on my computer

could you please explain me in more detail what you mean by doing joins as a first step. how can i simulate the for-each loop by joins?


thanks
kilia
hello everybody,

I have a problem concerning "loops in sql queries" and would like to explain it on a short simplified example.

there is one table containing website clicks with the following columns (Microsoft SQL):
- UserID for every user
- Kind of ressource (information, ...)
- Click-Time (Exact timestamp concerning the click, in seconds)




i am interested in clickstreams per "user" AND "per kind of ressource".
i want to perform an sql query for every userid AND (combined) kind of ressource. first, i want to identify for every the "beginning" (code 1), the inside (code 2) and the end (code 3) of a clickstream. a clickstream begins if the user didn't click (in the specific kind of ressource) for more than 5 minutes.
Second, i want to give a unique number for every clickstream.

final table should look like this:



the pseudocode looks probably like this:



i wrote the code in java with two loops - the algorithm inside the two loops is not as easy and needs a lot of comparisons, but the program works as it should. BUT because the table has more than 120 000 entities, it took about 8 hours to perform the task. this is much more time than i will have for such an operation in future). If i apply queries directly in ms sql server it takes only seconds for complicated operations).

Thus my question -
1. how should such an operation be performed?
2. Are there any possibilites to do it directly in ms sql server (two loops, one nested in the other one)?
3. Are there any tools?

I can't imagine that my solution is the fastest one (there are millions or rather billions of comparisons).


(The example is not exactly as my project is, thus don't ask about the logic of the table structure...)


it would be very nice if someone could help me....
Thanks a lot
kilia
Hello everybody

I just wrote a small tool which dynamicly produces a list of SQL statements with respect to a few often changing attributes:

(short abstract)

USE DatabaseName
GO

IF EXISTS(select name from master.dbo.sysdatabases WHERE name = 'Database') DROP DATABASE Database;

IF NOT EXISTS ( SELECT 1 FROM information_schema.columns WHERE column_name = 'Total' AND table_name = 'Table' )
BEGIN
ALTER TABLE tArticles_Welle3 ADD Total VARCHAR(6) NULL DEFAULT 'Total' WITH VALUES;
END

GO


and so on...

the whole query will then be stored in a .sql-File.

But instead of storing it in the sql File and then executing it manually in Microsoft SQL Server, I would like to send the statements to the server (they are stored in one String).

Statement stmt = connection.createStatement();
stmt.execute(methodWhichGivesTheListWithTheSQLStamementsBackAsAString());


The above code fragment does not work... e.g. the syntax GO is unknown and many more...
Is there a possibility to execute it out of a java tool or not?

Thanks a lot
Kilia

[ July 01, 2008: Message edited by: Kilia Verdon ]
[ July 01, 2008: Message edited by: Kilia Verdon ]
hello everybody,

actually i am coding a small tool. i am using ide eclipse. there i have built a project with a few classes and in the root of the project there is folder containing several .txt files.
if i read them with my application in eclipse, there is no problem. but then i built a jar file (using fat jar plugin for eclipse). now the tool can not find the .txt files anymore (even if they are present in the jar-file).
i looked up the internet for a solution but could not find anything.

can someone please help me?

Project:

controller.Application.java --> uses another class "InOut"

io.InOut.java --> this one acceses the files in the folder below

sql_templates/ --> Folder
sql_templates/generateCode.txt ---> many files like this


thanks a lot
kilia
15 years ago
thanks to everybody.

@manuel and ohters:
1. redhat dev studio sounds very nice, but I saw that it costs 99$. Or does a free version exist?

2. That's very nice. So I will internalize the concepts
- Servlets
- JSP
- JSF
- Hibernate.

That's all I need to learn to build powerful and beautiful small/middle sized webpages? If once I want to develop bigger applications or work in a team which develops bigger applications then I can still learn other concepts like struts, EJB, Java Message Services, JNDI and so on....
Or does anyone disagree to that? Is there something I really do have to learn to build "real" dynamic webpages?

kilia
16 years ago
JSF
thanks to everybody.

@manuel and ohters:
1. redhat dev studio sounds very nice, but I saw that it costs 99$. Or does a free version exist?

2. That's very nice. So I will internalize the concepts
- Servlets
- JSP
- JSF
- Hibernate.

That's all I need to learn to build powerful and beautiful small/middle sized webpages? If once I want to develop bigger applications or work in a team which develops bigger applications then I can still learn other concepts like struts, EJB, Java Message Services, JNDI and so on....
Or does anyone disagree to that? Is there something I really do have to learn to build "real" dynamic webpages?

kilia
16 years ago
JSF
Thanks for the answer.

I bought a book about Java EE 5 and read a few chapters until now (Servlets, JSP, Tag-Libraries, Struts and JSF. Now I've got a good idea of the different components and I can see their relations... I will internalize the mechanisms of Servlets, JSP and JSF in the next days.
But now I've an other few questions:

1. Actually I work with Eclipse but I could not find a plugin to easy develop JSFs. In NetBeans I could find a good implementation. But actually I am not familiar with NetBeans and I prefer Eclipse... Does anybody know a plugin for Eclipse?

2. The next chapters of my book are "JNDI", "EJB", "Java Message Service", Persistence API", "XSK, XPath and others", "Webservices".
What do you think: Do I have to learn all theses concepts at the moment if I don't work in a team and would like to develop only small or middle sized projects/websites?

3. I have basic knowledge of JDBC. The way to interact with the database like this is not very comfortable. So I would like to learn an other concept to access the database, like Persistence API or Hibernate. But I am not sure if that needs a lot of effort. Do I have to learn everything about EJB first? Do you think it is worth to learn things like this for small projects or not? Or would you work with JDBC?

Thanks to everybody, thanks to javaranch.
Kilia
16 years ago
JSF
Hi.

Thanks for your answer. I will follow your advise and learn Servlets and JSP the next days.
How you wrote: It seems like EJB, Struts ans JSF are alternative concepts/frameworks and replaces each other. Or is that not true?
Is Struts and JSF a little bit like SWT and Swing for normal java? Two concepts which are intended to solve the same problem?

thanks
kilia
16 years ago
JSF
Hello everybody,

I am relatively new to this platform. I already have some experience in java programming - I passed SCJP as well. Now I would like to learn dynamic web coding with Java EE 5. I would like to learn to code dynamic webpages as straightforward as possible (I know that it is not possible in a few days, but as soon as possible...).
I have some really really basic idea about servlets ans jsp. To me the mixture between HTML and Java doesn't look very comfortable. I already heard about Struts and Java Server Faces. And this frameworks seem to be very helpful when coding webpage.

My question:
1. What concepts, "languages syntaxes" and in which order should I learn? (servlets, jsp, jsf, struts etc...)
2. Servlets seem to be a old concept (mixture of java and html, not easy to read and maitain). But Servlets seems to be the basics as well...

There are so many frameworks, concept, languages, different servers... (JBoss, JSP, JSF, Struts, Hibernate, EJB, Tomcat, Glassfish...)! I really don't know exactly which of them are alternatives to others, which supplement the others.... For example: Can I learn Struts whithout solid knowledge of JSP?

Which concepts should I learn first, which way should I go?
1. Servlets
2. JSP
3. EJB
4. JSF

???

Thanks very much
Kilia
16 years ago
JSF
thank you very much for the statement.

greets
[ January 22, 2008: Message edited by: Kilia Verdon ]
hello kurt.
thanks for your answer. nice to know - like that I will be prepared to use more time on hard (long coded) questions (write down every iteration and so on). did you do scjp 5.0 or 6.0? does somebody know anything about 6.0 - i would like to do that as well in a few days.

another two question about the real exam:
1. do you get only one sheet of paper - or can you ask for more?
2. is it written in the real exam how much answers are true ("choose any two")... ? Because that is really helpfull.

Thanks and have a nice day
[ January 22, 2008: Message edited by: Kilia Verdon ]
hello everybody,

i will take scjp 5.0 next tuesday (in 2 days). i have learnt with books and different sample exams, specially with JQ+ 5.0.

Usually I need 90 minutes to solve a sample exam with 72 questions (in jq+), sometimes more. my scores are between 67 and 82 %.

My question is it now: How close are the JQ+ - Exams to the real exam concerning time intensity? Do I need more time in the real exam or are there also a few knowledge based questions which you can answer in a few seconds...?

Thanks for a quick answer an I hope to pass on tuesday.
Greets
[ January 22, 2008: Message edited by: Kilia Verdon ]