• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validation of database path, port number and ip address

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Just wanted to know if it is really necessary to validate the database path, port number and ip address in the assignment? I have a line in my assignment which says -

No authentication is required for database access.



My deadline is approaching so wanted to be sure if I can pass without doing it?

Thanks,
Bably Das
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Authentication has nothing to do with validations.

In my assignment I did lots of validations and I also limited the user input (for example: no chars can be entered in the port number field, only digits). I think you can pass without validating them, because it's not a must requirement. But how will your application react if I enter 'abcd' as port number. I don't think your application crashing (and showing a NumberFormatException) will result in a nice score.
 
Bably Das
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Roel for the reply. Yeah being new to software development world I was a bit confused about authentication and validations. I am doing the following validations:

1. Port number - allowing user to enter only digits upto maximum of 5 and then checking if the number entered is between 0-65535.
2. Database location - If a file exists in the location specified by user and can be read and written to. I decided not do any validations on the magic cookie.
3. IP address - if it is in the correct format ie, A valid ip-address must be in the form of xxx.xxx.xxx.xxx, where xxx is a number from 0-255.
I have decided to stick to ip-address as I found it difficult to validate the host name, hope thats acceptable.
4. customer id - A user can enter only positive numbers in the customer Id field and that must be 8 digits for it to be accepted as a valid customer id.

Hope thats sufficient to pass.
Thanks,
Bably Das
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bably Das wrote:Hope thats sufficient to pass.


No need to worry
 
Bably Das
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

No need to worry



Thanks Roel for the confirmation
 
reply
    Bookmark Topic Watch Topic
  • New Topic