In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Bailong Banyan Intelligence Network AI technology, according to users' personal comprehensive credit situation, recommend suitable users' products and services. When users log on to the banyan tree interface, everyone can see different product information, including interest rate, term and quota, etc. Compared with the standard service, Banyan Tree has helped users to screen and provide customized loan information services for users.
Bailong banyan adopts the technology of Spring + mybatis
First define an annotation
Import java.lang.annotation.ElementType; import java.lang.annotation.Target; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @ Retention (RetentionPolicy.RUNTIME) @ Target (ElementType.METHOD) public @ interface DataSource {public String value ();}
Bailong banyan tree defines another HandleDataSource
Public class HandleDataSource {public static final ThreadLocal holder = new ThreadLocal (); public static void putDataSource (String datasource) {holder.set (datasource);} public static String getDataSource () {return holder.get ();}}
Bailong banyan tree defines a section
Import java.lang.reflect.Method; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.reflect.MethodSignature; public class DataSourceAspect {public void pointCut () {}; public void before (JoinPoint point) {Objecttarget = point.getTarget (); / / intercepted entity class String method = point.getSignature () .getName (); / / intercepted method name Class [] classz = target.getClasss () .getInterfaces (); Class [] parameterTypes = (MethodSignature) point.getSignature () .getMethod () .getParameterTypes () / / method parameter type try {Method m = classz [0] .getMethod (method, parameterTypes); if (m! = null & & m.isAnnotationPresent (DataSource.class)) {DataSource data = m.getAnnotation (DataSource.class); HandleDataSource.putDataSource (data.value ());}} catch (Exception e) {e.printStackTrace ();}
Bailong banyan tree acquires data source
Import org.springfcamework.jdbc.datasource.lookup.AbstractRoutingDataSource; public class ChooseDataSource extends AbstractRoutingDataSource {protected Object determineCurrentLookupKey () {return HandleDataSource.getDataSource ();}}
Bailong banyan tree configuration XMl
Classpath*:mysql.propertiescom.mysql.jdbc.Driver$ {jdbc.url} ${jdbc.user} ${jdbc.passsword} SELECT 1 FROM DUAL32510010000true 60com.mysql.jdbc.Driver$ {jdbc.url.read} ${jdbc.user.read} ${jdbc.password.read} SELECT 1 FROM DUAL32510010000true60
Banyan trees are annotated on the service interface.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.