Click here to Skip to main content
15,903,385 members
Home / Discussions / Java
   

Java

 
GeneralRe: .properties file added to database Pin
David Skelly24-Jan-11 22:18
David Skelly24-Jan-11 22:18 
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 
yeah you are right i am learning java on my own and my only hope is in here. Hope you guys will understand if i asked something really simple. Yes what i want to do is load the properties from the database instead of loading from a properties file. I have 3 properties files in the project. I manage to change 2 of them and still have 1 not done yet.

I came across this problem for the third file. It is a .java file. My code as shown below:

public class emailNotification {

    private static final String SMTP_HOST_NAME = getProperties("SMTP_HOST_NAME");
    private static final int SMTP_HOST_PORT = Integer.parseInt(getProperties("SMTP_HOST_PORT"));
    private static final String SMTP_AUTH_USER = getProperties("SMTP_AUTH_USER");
    private static final String SMTP_AUTH_PWD = getProperties("SMTP_AUTH_PWD");

    private emailNotification() {

    }


I am unable to create a database connection in the public class even after i did the try and catch.
Any idea how shld i do this?

another question to ask:
Properties props = new Properties();
props.put("mail.transport.protocol", "smtps");


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.

modified on Thursday, January 27, 2011 1:39 AM

GeneralRe: .properties file added to database Pin
David Skelly26-Jan-11 22:23
David Skelly26-Jan-11 22:23 
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 

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.