Milos Radovic

Greenhorn
+ Follow
since Jun 01, 2016
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Milos Radovic

Hi guys, in the end, I solved the problem by downloading the PDF on my computer using Javas Robot Class and then parse the PDF.

The ReadPDFde class:






Mian Class (GermanyDB):


2 years ago
If I just paste the URL into the browser it returns me to the login page of the application.
2 years ago
It turns out that it is an embedded PDF.

The URL looks similar to this: http://something.com/printed.php?printable=yes&reanudar=&detalle=&idioma=1¬ax=no&smart=3&pageBreaks=[]
The source code looks like this:





You have any idea how to solve this?
2 years ago
Hi everyone,

I'm trying to parse a PDF file that is opened in Chrome. Here is the relevant code:

Main Class:




ReadPDF Class:

 


Console error message:

Exception in thread "main" java.io.IOException: Error: End-of-File, expected line
at org.apache.pdfbox.pdfparser.BaseParser.readLine(BaseParser.java:1519)
at org.apache.pdfbox.pdfparser.PDFParser.parseHeader(PDFParser.java:360)
at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:186)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1230)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1197)
at switzerlandDB.ReadPDF.readPDF(ReadPDF.java:36)
at switzerlandDB.SwitzerlandDB.main(SwitzerlandDB.java:1182)

The error "at switzerlandDB.ReadPDF.readPDF(ReadPDF.java:36)" referes to this line:



The error at "switzerlandDB.SwitzerlandDB.main(SwitzerlandDB.java:1182)" referes to this line:




Anyone knows what am I doing wrong?
Thank you!
2 years ago
Hi guys, I found the solution.

The problem was that I should have called OracleCallableStatement and not CallableStatement and therefore I should have used and not

Here is the code:




Thanks,

Cheers!
2 years ago
Input parameters are:

<Return Value> Elinktypes.ref_collection OUT N/A -- this is what the function is reurning it is a cursor value type

P_CODMARKET VARCHAR2(4) IN NULL
P_CODBRAND VARCHAR2(2) IN NULL
P_CODMODEL VARCHAR2(3) IN NULL
P_CODVERSION VARCHAR2(3) IN NULL
P_CODSERIE VARCHAR2(1) IN NULL
P_CODSPECIALSERIE VARCHAR2(3) IN NULL
P_CODUPHOLSTERY VARCHAR2(3) IN NULL
P_CODLANGUAGE VARCHAR2(5) IN NULL
P_CODBILLCATEGORY VARCHAR2(2) IN NULL
P_ENVIRONMENT CHAR(200) IN NULL
2 years ago
Hi everyone,
I am trying to call an Oracle SQL function using java CallableStatement.
The application is giving me this error: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 1.

Here is the code:



Does anybody know what am I doing wrong?

Thanks,
Regards

2 years ago
Thank you for your reply
I think I understand some parts. At this moment I am calling GetAllCustomers.jsp from header in my webapp. Here is the code:



Instead of calling GetAllCustomers.jsp, I should be calling Customer.java right?
In Customer.java the code from getAll method should be placed in doGet method?
Let me first try to fix that and from there I will see if I could solve the rest of the problems.
Thanks
Hi guys, I’m trying to make a small web application (like an online store) and for that I am using MySQL database, Java servlets, JSP and CSS.
I am still new to Java and this is the first time that I am making this type of application so I have some problems.
For example, I succeeded to display all data from database table using a method in servlet and then calling the method in JSP page.
The problem is that a browser is showing the data but without rest of the HTML code that is inside of the JSP page. So JSP is not showing title, header, footer ...
I also tried to solve the problem by using request attributes and then pass data from servlet to jsp, but on that way I didn’t manage to get data from database.
How can I display both HTML content and data from database in JSP page and what is the best way to do this?
Here is relevant part of the code:      

Database connection (DatabaseConn.java) :  



Customer.java :



GetAllCustomers.jsp :


Campbell Ritchie wrote:Didn't the tutorial link help you? Please tell us what happens; we can only help if we have the full details.



I solved the problem.    I just deleted the class UsersDao and put the code from the Insert method into the button ActionListener in Main class.
Here is the code:

class ConnectionFactory:



class Main:

4 years ago

Campbell Ritchie wrote:Don't use AWT display classes; they have been regarded as obsolete for about 15 years. Use Swing or JavaFX instead.


Thanks for your reply. I am aware of that, however it is asked of me to use AWT for my assignment. I tried and tried to make this code work but I just couldn't to it.
I would rally appreciate if anybody could give me some hints and ideas about how can I correct my code.
 
4 years ago
Hello everyone!
For my assignment I need to make application that will take the text from the AWT TextField and insert it into MySQL database.
I wrote some code which doesn’t show any errors and it is inserting the text into database but not the one from the TextFields.
Can anyone help me solve this problem?
Thanks in advance.
Here is the code:

class ConnectionFactory:



class UsersDao:



class Main:

4 years ago

Roel De Nijs wrote:
Looks great! Have another cow for all refactoring effort!



Thank you again for your help

Best regards,
Milos

Roel De Nijs wrote:
2/ in the update query you are still using one actual value (the headline) instead of a placeholder, so you can truely benefit from using prepared statements (I think it's the 2nd or 3rd time I have mentioned this issue)



You are right, sorry. I think I made the changes this time:

ConnectionFactory class:



BookDao class:



Main class:


Best regards,
Milos

Dave Tolls wrote:Since ID is an int of some sort (as shown by your INSERT code), then shouldn't it be treated as an int for your DELETE and UPDATE ones as well?



You are right, here is the BookDao class with corrections:



Thanks