如何在其他方法中获取context连接,想在其他方法中调用
2016-09-29 10:15:04 获取数据库[scgj]连接失败,可能原因:数据库已经关闭或者数据源配置错误
javax.naming.NameNotFoundException: Name scgj is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.justep.baas.data.DataUtils.getConnection(Unknown Source)
at tongyingAdminbaas.GetMember.get(GetMember.java:46)
at tongyingAdminbaas.GetMember.run(GetMember.java:27)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
com.justep.baas.data.sql.SQLException: 获取数据库[scgj]连接失败,可能原因:数据库已经关闭或者数据源配置错误
at com.justep.baas.data.DataUtils.getConnection(Unknown Source)
at tongyingAdminbaas.GetMember.get(GetMember.java:46)
at tongyingAdminbaas.GetMember.run(GetMember.java:27)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: javax.naming.NameNotFoundException: Name scgj is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
... 5 more
2016-09-29 10:15:18
2016-09-29 10:15:18 获取数据库[scgj]连接失败,可能原因:数据库已经关闭或者数据源配置错误
javax.naming.NameNotFoundException: Name scgj is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at com.justep.baas.data.DataUtils.getConnection(Unknown Source)
at tongyingAdminbaas.GetMember.get(GetMember.java:46)
at tongyingAdminbaas.GetMember.run(GetMember.java:27)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
com.justep.baas.data.sql.SQLException: 获取数据库[scgj]连接失败,可能原因:数据库已经关闭或者数据源配置错误
at com.justep.baas.data.DataUtils.getConnection(Unknown Source)
at tongyingAdminbaas.GetMember.get(GetMember.java:46)
at tongyingAdminbaas.GetMember.run(GetMember.java:27)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: javax.naming.NameNotFoundException: Name scgj is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
... 5 more