Java MySQL query named parameters? -


is there way have named parameters in java mysql query?

like this:

select * table col1 = :val1 , col2 = :val2 

instead of this:

select * table col1 = ? , col2 = ? 

update: im' using java.sql.*, interested in alternatives capable of this.

maybe hibernate choice you. provided query style description, , it's powerful , convenient persistence work you'll feel cool. e.g

query query = sesion.createquery("from student s s.age = :age"); query.setproperties(student); 


see doc:http://docs.jboss.org/hibernate/orm/3.2/api/org/hibernate/query.html#setparameter(java.lang.string, java.lang.object)


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -