• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Postgresql custom data type

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Recently started learning JSP to make a web application using Postgresql as the backend. I've only been using the JSTL so far when programming the web front end and not doing any raw java coding. I added a custom data type to Postgresql and got that working on the database end. Now I've come across the problem where JSP is reporting back that I can't insert the data because the types are missmatched (form is sending the type VARCHAR and it's expecting my custom type). I saw how to fix this for when I need to insert Integers using fmt:parseNumber. I'm kind of lost now how to parse for my custom type.

Thanks!
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your custom type should be converted to one of the "normal" Java types long before it gets to the UI. Or are you using the dreaded JSTL SQL tags?
 
Keith Fiske
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using <sql:update> if that's what you mean, yes. Guess custom data types are going beyond what JSTL sql tags can provide?
 
Keith Fiske
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just saw your other reply to someone else asking about JSTL SQL. I did not realize that was not best practice to use it like that. I was planning on going to the MVC architecture but my project is just starting out and I've never actually put MVC to use yet. Guess now at the beginning is a good time to change gears and start it the right way. Appreciate your help!
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good plan! And you're welcome.
 
Whatever you say buddy! And I believe this tiny ad too:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic