数据库配置一般在哪个文件,问下数据库配置文件在哪里
来源:整理 编辑:黑码技术 2024-01-06 16:51:06
本文目录一览
1,问下数据库配置文件在哪里

2,齐博CMSB2B商务系统数据库配置文件在哪
一般都是config.php这样命名的,找找类似的文件夹或者文件。
3,aspx数据库配置文件在哪里
<appSettings><add key="ConnectionString" value="server=localhost;uid=sa;pwd=;database=pubs"/></appSettings>using System.Configuration;下面是获取连接SqlConnection myConn=new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
4,求助数据库配置文件是哪个
更新自定义页面模版文件也不行`还是生成不了`部分文件又可以配置数据库配置文件的方法: 1.首先先创建一个db.properties的配置文件。在配置文件中输入配置信息如下: driver=com.microsoft.sqlserver.jdbc.SQLServerDriver url=jdbc:sqlserver://localhost:1433;DatabaseName=books user=sa password=sa 2.创建一个加载db.properties的文件Env.java。在java文件中加载配置信息如下: public class Evn extends Properties{ private static Evn instance; private Evn(){ //通过构造方法读取配置文件 InputStream is=getClass().getResourceAsStream("/db.properties"); try { load(is); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static Evn getInstance(){ //单例模式创建、获得对象实例。if(instance==null){ makeInstance(); } return instance; } public static synchronized void makeInstance() { if(instance==null){ instance=new Evn(); } } } 3.读取数据方法 public class Test { public static void main(String[] args){ String driver=Env.getInstance().getProperty("driver"); String url=Env.getInstance().getProperty("url"); String user=Env.getInstance().getProperty("user"); String password=Env.getInstance().getProperty("password"); System.out.println(driver); System.out.println(url); System.out.println(user); System.out.println(password); } }
5,网站数据库配置一般在哪个文件
一般情况下我们都是把文件写在conn.asp中。你找一下看有没有这个文件。在哪个文件夹不一定。这个看个人习惯了。。ASP连接 MYSQL的话是要装ODBC驱动的。你出现的是500 内部服务器错误。具体要看是什么错误了。建议你把友好HTTP错误提示关闭。然后再看是哪一行出了错误。是什么错误。。。 把你的代码拿上来看一下.mappath应该是可以用父目录的呀..配置数据库配置文件的方法: 1.首先先创建一个db.properties的配置文件。在配置文件中输入配置信息如下: driver=com.microsoft.sqlserver.jdbc.sqlserverdriver url=jdbc:sqlserver://localhost:1433;databasename=books user=sa password=sa 2.创建一个加载db.properties的文件env.java。在java文件中加载配置信息如下: public class evn extends properties{ private static evn instance; private evn(){ //通过构造方法读取配置文件 inputstream is=getclass().getresourceasstream("/db.properties"); try { load(is); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } public static evn getinstance(){ //单例模式创建、获得对象实例。if(instance==null){ makeinstance(); } return instance; } public static synchronized void makeinstance() { if(instance==null){ instance=new evn(); } } } 3.读取数据方法 public class test { public static void main(string[] args){ string driver=env.getinstance().getproperty("driver"); string url=env.getinstance().getproperty("url"); string user=env.getinstance().getproperty("user"); string password=env.getinstance().getproperty("password"); system.out.println(driver); system.out.println(url); system.out.println(user); system.out.println(password); } }
文章TAG:
数据 数据库 配置 一般 数据库配置一般在哪个文件