Click here to Skip to main content
15,891,529 members
Home / Discussions / Java
   

Java

 
GeneralRe: .properties file added to database Pin
pancakeleh24-Jan-11 22:42
pancakeleh24-Jan-11 22:42 
GeneralRe: .properties file added to database Pin
TorstenH.25-Jan-11 2:12
TorstenH.25-Jan-11 2:12 
GeneralRe: .properties file added to database Pin
Richard MacCutchan25-Jan-11 3:01
mveRichard MacCutchan25-Jan-11 3:01 
GeneralRe: .properties file added to database Pin
David Skelly25-Jan-11 3:41
David Skelly25-Jan-11 3:41 
GeneralRe: .properties file added to database Pin
pancakeleh25-Jan-11 16:18
pancakeleh25-Jan-11 16:18 
GeneralRe: .properties file added to database Pin
David Skelly25-Jan-11 22:27
David Skelly25-Jan-11 22:27 
GeneralRe: .properties file added to database [modified] Pin
pancakeleh26-Jan-11 15:15
pancakeleh26-Jan-11 15:15 
GeneralRe: .properties file added to database Pin
David Skelly26-Jan-11 22:23
David Skelly26-Jan-11 22:23 
pancakeleh wrote:
I am unable to create a database connection in the public class even after i did the try and catch.


What have you tried? If you read the tutorial on JDBC it shows you how to create a database connection. I am not a mind-reader, so I have no idea why you are having a problem unless you give us some more information.


pancakeleh wrote:
The above code is to create a new property right? is it appropriate for me to use in my case whereby i will load the properties from the database instead of loading from a properties file.


Yes, this is pretty much it. In pseudo-code you would do something like:

  • Connect to the database
  • Get the properties from the database using a SELECT statement
  • Iterate over the result set
  • For each row in the result set, add key/value into the properties map
  • Close database connection

That's roughly it.
GeneralRe: .properties file added to database Pin
Richard MacCutchan26-Jan-11 22:54
mveRichard MacCutchan26-Jan-11 22:54 
AnswerRe: .properties file added to database Pin
TorstenH.23-Jan-11 22:47
TorstenH.23-Jan-11 22:47 
Questionbytecode_programming Pin
geniuspc19-Jan-11 9:45
geniuspc19-Jan-11 9:45 
AnswerRe: bytecode_programming Pin
Richard MacCutchan19-Jan-11 21:52
mveRichard MacCutchan19-Jan-11 21:52 
GeneralRe: bytecode_programming Pin
David Skelly19-Jan-11 22:36
David Skelly19-Jan-11 22:36 
GeneralRe: bytecode_programming Pin
Richard MacCutchan20-Jan-11 1:34
mveRichard MacCutchan20-Jan-11 1:34 
AnswerRe: bytecode_programming Pin
Cedric Moonen19-Jan-11 22:19
Cedric Moonen19-Jan-11 22:19 
AnswerRe: bytecode_programming Pin
David Skelly19-Jan-11 22:29
David Skelly19-Jan-11 22:29 
AnswerRe: bytecode_programming Pin
_Erik_20-Jan-11 3:48
_Erik_20-Jan-11 3:48 
AnswerRe: bytecode_programming Pin
Nagy Vilmos20-Jan-11 4:56
professionalNagy Vilmos20-Jan-11 4:56 
Questionthread does not return from Runtime.exec Pin
WernerP19-Jan-11 1:55
WernerP19-Jan-11 1:55 
AnswerRe: thread does not return from Runtime.exec Pin
Peter_in_278019-Jan-11 12:31
professionalPeter_in_278019-Jan-11 12:31 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP19-Jan-11 12:52
WernerP19-Jan-11 12:52 
GeneralRe: thread does not return from Runtime.exec Pin
Peter_in_278019-Jan-11 13:07
professionalPeter_in_278019-Jan-11 13:07 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP19-Jan-11 23:27
WernerP19-Jan-11 23:27 
GeneralRe: thread does not return from Runtime.exec Pin
WernerP20-Jan-11 6:32
WernerP20-Jan-11 6:32 
QuestionAbout Calculate.... Pin
Khalil Adam19-Jan-11 0:45
Khalil Adam19-Jan-11 0:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.