0

0

无法调用“javafx.scene.control.TableColumn.setCellValueFactory(javafx.util.Callback)”,因为“this.colName”为 null

PHPz

PHPz

发布时间:2024-02-10 13:15:18

|

966人浏览过

|

来源于stackoverflow

转载

php小编新一在使用javafx时遇到了一个问题,即在调用"javafx.scene.control.tablecolumn.setcellvaluefactory(javafx.util.callback)"时出现了"this.colname为null"的错误。这个错误的原因是因为colname为空,导致无法调用该方法。为了解决这个问题,我们需要检查colname是否正确初始化,并且确保其不为空。只有在colname正确初始化之后,才能成功调用"javafx.scene.control.tablecolumn.setcellvaluefactory(javafx.util.callback)"方法。希望以上解答对您有帮助!

问题内容

所以我的问题是我无法将数据显示到表视图,我不明白为什么 我有一个表单使用 productcontroller 和显示 tableview 方法,在另一个控制器 cardproductcontrller 中,我在 addfcn 方法中调用 productcontroller 中的方法,它返回错误:

无法调用 javafx.scene.control.tablecolumn.setcellvaluefactory(javafx.util.callback),因为 this.colname 为 null

这里有更多详细错误:

java.lang.nullpointerexception: cannot invoke "javafx.scene.control.tablecolumn.setcellvaluefactory(javafx.util.callback)" because "this.colname" is null
    at application.productcontroller.showorderdetail(productcontroller.java:409)
    at application.cardprodcontroller.addfcn(cardprodcontroller.java:169)
    at java.base/jdk.internal.reflect.directmethodhandleaccessor.invoke(directmethodhandleaccessor.java:103)
    at java.base/java.lang.reflect.method.invoke(method.java:580)
    at com.sun.javafx.reflect.trampoline.invoke(methodutil.java:72)
    at java.base/jdk.internal.reflect.directmethodhandleaccessor.invoke(directmethodhandleaccessor.java:103)
    at java.base/java.lang.reflect.method.invoke(method.java:580)
    at javafx.base@21/com.sun.javafx.reflect.methodutil.invoke(methodutil.java:270)
    at javafx.fxml@21/com.sun.javafx.fxml.methodhelper.invoke(methodhelper.java:84)
    at javafx.fxml@21/javafx.fxml.fxmlloader$methodhandler.invoke(fxmlloader.java:1855)
    at javafx.fxml@21/javafx.fxml.fxmlloader$controllermethodeventhandler.handle(fxmlloader.java:1726)
    at javafx.base@21/com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:86)
    at javafx.base@21/com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:232)
    at javafx.base@21/com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:189)
    at javafx.base@21/com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:59)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:58)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:74)
    at javafx.base@21/com.sun.javafx.event.eventutil.fireevent(eventutil.java:49)
    at javafx.base@21/javafx.event.event.fireevent(event.java:198)
    at javafx.graphics@21/javafx.scene.node.fireevent(node.java:8875)
    at javafx.controls@21/javafx.scene.control.button.fire(button.java:203)
    at javafx.controls@21/com.sun.javafx.scene.control.behavior.buttonbehavior.mousereleased(buttonbehavior.java:207)
    at javafx.controls@21/com.sun.javafx.scene.control.inputmap.inputmap.handle(inputmap.java:274)
    at javafx.base@21/com.sun.javafx.event.compositeeventhandler$normaleventhandlerrecord.handlebubblingevent(compositeeventhandler.java:247)
    at javafx.base@21/com.sun.javafx.event.compositeeventhandler.dispatchbubblingevent(compositeeventhandler.java:80)
    at javafx.base@21/com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:232)
    at javafx.base@21/com.sun.javafx.event.eventhandlermanager.dispatchbubblingevent(eventhandlermanager.java:189)
    at javafx.base@21/com.sun.javafx.event.compositeeventdispatcher.dispatchbubblingevent(compositeeventdispatcher.java:59)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:58)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.basiceventdispatcher.dispatchevent(basiceventdispatcher.java:56)
    at javafx.base@21/com.sun.javafx.event.eventdispatchchainimpl.dispatchevent(eventdispatchchainimpl.java:114)
    at javafx.base@21/com.sun.javafx.event.eventutil.fireeventimpl(eventutil.java:74)
    at javafx.base@21/com.sun.javafx.event.eventutil.fireevent(eventutil.java:54)
    at javafx.base@21/javafx.event.event.fireevent(event.java:198)
    at javafx.graphics@21/javafx.scene.scene$mousehandler.process(scene.java:3984)
    at javafx.graphics@21/javafx.scene.scene.processmouseevent(scene.java:1890)
    at javafx.graphics@21/javafx.scene.scene$scenepeerlistener.mouseevent(scene.java:2708)
    at javafx.graphics@21/com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:411)
    at javafx.graphics@21/com.sun.javafx.tk.quantum.glassvieweventhandler$mouseeventnotification.run(glassvieweventhandler.java:301)
    at java.base/java.security.accesscontroller.doprivileged(accesscontroller.java:400)
    at javafx.graphics@21/com.sun.javafx.tk.quantum.glassvieweventhandler.lambda$handlemouseevent$2(glassvieweventhandler.java:450)
    at javafx.graphics@21/com.sun.javafx.tk.quantum.quantumtoolkit.runwithoutrenderlock(quantumtoolkit.java:424)
    at javafx.graphics@21/com.sun.javafx.tk.quantum.glassvieweventhandler.handlemouseevent(glassvieweventhandler.java:449)
    at javafx.graphics@21/com.sun.glass.ui.view.handlemouseevent(view.java:551)
    at javafx.graphics@21/com.sun.glass.ui.view.notifymouse(view.java:937)
    at javafx.graphics@21/com.sun.glass.ui.win.winapplication._runloop(native method)
    at javafx.graphics@21/com.sun.glass.ui.win.winapplication.lambda$runloop$3(winapplication.java:185)
    at java.base/java.lang.thread.run(thread.java:1583)

这里是代码: 卡产品控制器:

package application;

import java.net.url;
import java.sql.connection;
import java.sql.preparedstatement;
import java.sql.resultset;
import java.sql.sqlexception;
import java.util.date;
import java.util.optional;
import java.util.resourcebundle;

import javafx.fxml.fxml;
import javafx.fxml.initializable;
import javafx.scene.control.alert;
import javafx.scene.control.alert.alerttype;
import javafx.scene.control.button;
import javafx.scene.control.buttontype;
import javafx.scene.control.label;
import javafx.scene.control.spinner;
import javafx.scene.control.spinnervaluefactory;
import javafx.scene.image.image;
import javafx.scene.image.imageview;
import javafx.scene.layout.borderpane;

public class cardprodcontroller implements initializable {

    @fxml
    private button addbtn;

    @fxml
    private borderpane cardform;

    @fxml
    private imageview imageview;

    @fxml
    private label name;

    @fxml
    private label price;

    @fxml
    private spinner quantity;
    
    private productmodel productm;
    
    private image image;
    
    private string proid;
    private string pro_image;
    private string pro_date;
    
    private spinnervaluefactory spin;
    
    @fxml 
    private connection connection;
    private preparedstatement prepare;
    private resultset result;
    private alert alert;

    private double pr;
    private int cusid;
    
    public void setdata(productmodel productm) {
        this.productm = productm;
        
        pro_image = productm.getproductimage();
        pro_date = string.valueof(productm.getdate());
        proid = productm.getproductid();
        name.settext(productm.getproductname());
        price.settext(string.valueof(productm.getproductprice()));
        string path = "file:" + productm.getproductimage();
        image = new image(path, 190, 130, false, true);
        imageview.setimage(image);
        pr = productm.getproductprice();

    }
    
    private int qty;
    private double totalp;
    private string orddid;
    public void addfcn() throws sqlexception {
            productcontroller pc = new productcontroller();
            pc.customerid(); 
            pc.order_detailid();
            qty = quantity.getvalue();
            string check = "";
            string checkavailable = "select pro_status from product where pro_id = '" + proid + "'";
            
            connection = database.connect();
            try {
                int checks = 0;
                string checkstock = "select pro_quantity from product where pro_id = '" + proid + "'";

                prepare = connection.preparestatement(checkstock);
                result = prepare.executequery();
                
                if(result.next()) {
                    checks = result.getint("pro_quantity");
                }      
                
                if(checks == 0){
                    string updatestock = "update product set pro_status = 'unavailable' where pro_id = '"+proid+"'";   
                    //update to database to mark it as unavailable
                    prepare = connection.preparestatement(updatestock);
                    prepare.executeupdate();
                }
                prepare = connection.preparestatement(checkavailable);
                result = prepare.executequery();

                if (result.next()) {
                    check = result.getstring("pro_status");
                }
                if (!check.equals("available") || qty == 0) {
                    alert = new alert(alerttype.error);
                    alert.settitle("error message");
                    alert.setheadertext(null);
                    alert.setcontenttext("product currently unavalible or we run out");
                    alert.showandwait();
                } else {
                    if (checks < qty) {
                        alert = new alert(alerttype.error);
                        alert.settitle("error message");
                        alert.setheadertext(null);
                        alert.setcontenttext("invalid. this product is out of stock");
                        alert.showandwait();
                    } else {
                        pro_image = pro_image.replace("\\", "\\\\");
                        
                        string insertdata = "insert into order_detail "
                                + "(cus_id, ord_id, pro_id ,pro_name, pro_price, pro_quantity, orderdate) "
                                + "values(?,?,?,?,?,?,?)";
                        prepare = connection.preparestatement(insertdata);
                        prepare.setstring(1, string.valueof(data.cusid));
                        
                        orddid = data.orddid;
                        prepare.setstring(2, orddid);
                        prepare.setstring(3, proid);
                        prepare.setstring(4, name.gettext());
                        
                        totalp = (qty * pr);
                        prepare.setstring(5, string.valueof(totalp));
                        prepare.setstring(6, string.valueof(qty));
                        
                        date date = new date();
                        java.sql.date sqldate = new java.sql.date(date.gettime());
                        prepare.setstring(7, string.valueof(sqldate));
                        
                        prepare.executeupdate();

                        int upstock = checks - qty;

                        string updatestock = "update product set pro_quantity = " + upstock + " where pro_id = '"+proid+"'";
                        //update product to mark it's quantity as decreased as being order by customer 
                        prepare = connection.preparestatement(updatestock);
                        prepare.executeupdate();
                        
                        alert = new alert(alerttype.information);
                        alert.settitle("information message");
                        alert.setheadertext(null);
                        alert.setcontenttext("successfully added!");
                        optional option = alert.showandwait();
                        
                        if(option.get().equals(buttontype.ok)) {
                            
                            
                            pc.showorderdetail();
                        }
                        //pc.menugettotal();//tinh sau
                    }
                }
            } catch (exception e) {
                e.printstacktrace();
            }   
        }
    
    public void setquantity() {
        spin = new spinnervaluefactory.integerspinnervaluefactory(1, 100, 0);
        quantity.setvaluefactory(spin);
    }
    
    @override
    public void initialize(url arg0, resourcebundle arg1) {
        setquantity();
    }
    
}

产品控制器:

package application;

import java.io.ioexception;
import java.net.url;
import java.sql.connection;
import java.sql.preparedstatement;
import java.sql.resultset;
import java.sql.sqlexception;
import java.util.optional;
import java.util.resourcebundle;

import com.mysql.cj.x.protobuf.mysqlxcrud.column;

import javafx.collections.fxcollections;
import javafx.collections.observablelist;
import javafx.event.actionevent;
import javafx.fxml.fxml;
import javafx.fxml.fxmlloader;
import javafx.fxml.initializable;
import javafx.geometry.insets;
import javafx.scene.node;
import javafx.scene.parent;
import javafx.scene.scene;
import javafx.scene.control.alert;
import javafx.scene.control.alert.alerttype;
import javafx.scene.control.button;
import javafx.scene.control.buttontype;
import javafx.scene.control.label;
import javafx.scene.control.tablecolumn;
import javafx.scene.control.tableview;
import javafx.scene.control.cell.propertyvaluefactory;
import javafx.scene.layout.anchorpane;
import javafx.scene.layout.gridpane;
import javafx.scene.layout.pane;
import javafx.stage.stage;

public class productcontroller implements initializable{
    @fxml
    private gridpane gridprod;

    @fxml
    private button clbtn;

    @fxml
    private button donebtn;
 
    @fxml
    private button clrbtn;

    @fxml
    private tablecolumn colname;

    @fxml
    private tablecolumn colprice;

    @fxml
    private tablecolumn colquantity;
    
    @fxml
    private tableview orderview;
    
    @fxml
    private button paybtn;

    @fxml
    private button printbillbtn;

    @fxml
    private label totalbill;
    
    @fxml 
    private connection connection;
    private preparedstatement prepare;
    private resultset result;
    private alert alert;
    
    @fxml
    private stage sidestage;
    private scene scene;
    private parent root;

    private int cid;
    public void customerid() throws sqlexception {
         string sql = "select max(cus_id) from customer";
         connection = database.connect();
         
         try {
             prepare = connection.preparestatement(sql);
             result = prepare.executequery();
             if (result.next()) {
                 cid = result.getint("max(cus_id)");
             }
             string checkcid = "select max(cus_id) from receipt";
             prepare = connection.preparestatement(checkcid);
             result = prepare.executequery();
             int checkid = 0;
             if (result.next()) {
                 checkid = result.getint("max(cus_id)");
             }
             if (cid == 0) {
                 cid += 1;
             } else if (cid == checkid) {
                 cid += 1;
             }
             data.cusid = cid;
         } catch (exception e) {
             e.printstacktrace();
         }
    }
    
    private string odid;
    public void order_detailid() throws sqlexception {
     string sql = "select max(ord_id) from order_detail";
        connection = database.connect();
        
        try {
            prepare = connection.preparestatement(sql);
            result = prepare.executequery();
            if (result.next()) {
                odid = result.getstring("max(ord_id)");
            }
            string checkodid = "select max(ord_id) from receipt ";
            prepare = connection.preparestatement(checkodid);
            result = prepare.executequery();
            string checkid = null;
            if (result.next()) {
                checkid = result.getstring("max(ord_id)");
            }
            if (odid == null) {
                string aim = "ord-" + 0;
                odid = aim + 1;
            } else if (odid == checkid) {
                string aim = "ord-" + 0;
                odid = aim + 1;
            }
            data.orddid = odid;
            system.out.println(data.orddid);
        } catch (exception e) {
            e.printstacktrace();
        }
   }
    

       private observablelist carddatalist = fxcollections.observablearraylist();
        
        public observablelist getdata(){
            
            observablelist listdata = fxcollections.observablearraylist();
            
            string getdata = "select * from product";
            try {
                connection = database.connect();
            } catch (sqlexception e) {
                // todo auto-generated catch block
                e.printstacktrace();
            }
            try {
                prepare = connection.preparestatement(getdata);
                result = prepare.executequery();
                
                productmodel productm;
                
                while(result.next()) {
                    productm = new productmodel(result.getint("id")
                                                ,result.getstring("pro_id")
                                                , result.getstring("pro_name")
                                                , result.getdouble("pro_price")
                                                , result.getint("pro_quantity")
                                                , result.getstring("pro_image"));
                    listdata.add(productm);
                }
            }catch (sqlexception e) {
                // todo: handle exception
                e.printstacktrace();
            }
            return listdata;
        }
        
        public void menuprod() {
            carddatalist.clear();
            carddatalist.addall(getdata());
            
            int row = 0; 
            int column = 0;
            gridprod.getchildren().clear();
            gridprod.getrowconstraints().clear();
            gridprod.getcolumnconstraints().clear();
            
            for(int i  = 0; i < carddatalist.size(); i++) {
                try {
                    fxmlloader loader = new fxmlloader();
                    loader.setlocation(getclass().getresource("cardproduct.fxml"));
                    pane pane = loader.load();
                    cardprodcontroller cpc = loader.getcontroller();
                    cpc.setdata(carddatalist.get(i));
                    
                    if(column == 3) {
                        column = 0;
                        row += 1;
                    }
                    
                    gridprod.add(pane, column++, row);
                    
                    gridpane.setmargin(pane, new insets(10));
                }catch (ioexception e) {
                    // todo: handle exception
                    e.printstacktrace();
                }
            }
        }
        
        public void clfcn(actionevent event) throws ioexception {
            
            root = fxmlloader.load(getclass().getresource("staffsection.fxml"));
            sidestage = (stage)((node)event.getsource()).getscene().getwindow();
            scene = new scene(root);
            sidestage.setscene(scene);
            sidestage.setresizable(false);
            sidestage.show();
        }
        
        public void donefcn(actionevent event) throws ioexception {
            
            root = fxmlloader.load(getclass().getresource("staffsection.fxml"));
            sidestage = (stage)((node)event.getsource()).getscene().getwindow();
            scene = new scene(root);
            sidestage.setscene(scene);
            sidestage.setresizable(false);
            sidestage.show();
        }
        
        public observablelist orderdlist() throws sqlexception {
               observablelist olist = fxcollections.observablearraylist();
               
               string getdata = "select pro_name, pro_price, pro_quantity from order_detail";
               connection = database.connect();
               try {
                    prepare = connection.preparestatement(getdata);
                    result = prepare.executequery();
                    
                    order_detailmodel orddm;
                    while(result.next()) {
                        orddm = new order_detailmodel(result.getstring("pro_name")
                                                        ,result.getdouble("pro_price")
                                                        ,result.getint("pro_quantity"));
                        olist.add(orddm);
                    }
               }catch (exception e) {
                e.printstacktrace();
                system.out.println(e.getmessage());
            }
            return olist; 
        }
        
        observablelist listordd;
        public void showorderdetail() {
            try {
                
                listordd = orderdlist();
                
                colname.setcellvaluefactory(new propertyvaluefactory<>("pro_name"));
                colprice.setcellvaluefactory(new propertyvaluefactory<>("pro_price"));
                colquantity.setcellvaluefactory(new propertyvaluefactory<>("pro_quantity"));
                
                orderview.setitems(listordd);
                
            }catch (exception e) {
                e.printstacktrace();
                e.getmessage();
            }
        }

    @override
    public void initialize(url arg0, resourcebundle arg1) {
        getdata();
        menuprod();
    }
}

fxml 文件使用 productcontroller :

立即学习Java免费学习笔记(深入)”;


















   

我几乎做了所有事情,使用chatgpt得到了ofc的帮助,但仍然不知道为什么,我认为我的sql是错误的?

解决方法

在 fxml 中指定控制器时,不要在代码中创建控制器

切勿在由 fxml 文件中的 fx:controller 属性指定的控制器上调用 new

此代码错误

ProductController pC = new ProductController();

有关更多信息,另请参阅:

当您可以在代码中创建新控制器

在控制器上调用 new 的唯一有效情况是如果这两个条件都为 true:

  • 您将调用 setcontroller 在加载 fxml 之前在 fxmlloader 上。

并且

X Detector
X Detector

最值得信赖的多语言 AI 内容检测器

下载
  • 正在加载的 fxml 文件中指定控制器。

但是,您并没有做任何这些事情。

来自 setcontroller 的文档:

有关在代码中设置控制器的示例,请参阅此答案中标题为“在 fxmlloader 上设置控制器”的部分:

您可能希望在代码中设置控制器的一种情况是与 setcontroller 构造结合使用,如 oracle 教程中所述:

在代码中创建新控制器的常见问题

只有 fx:root 会将控制器中的 fxmlloader 注释字段初始化为 fxml 文件中配置的值。如果您只是在代码中创建一个新的控制器实例,而没有在 fxmlloader 上设置该控制器实例并调用 @fxml 来初始化控制器实例,则控制器实例中的所有 load() 注释字段都将为 @fxml

此外,如果您还在其他地方加载了 fxml,并且 fxml 引用了像您一样的控制器,那么当您加载 fxml 时,加载器将创建您指定的控制器的实例在 fxml 中。因此,如果您随后在控制器上调用 null,您将获得控制器的另一个实例,该实例与 new 创建的实例以及由 load() 使用的方法。

替代方法

通常,当人们创建新的控制器时,他们应该做的是:

或者

  • 重构他们的代码,以便他们在尝试使用它的地方不需要控制器引用(例如通过 应用 mvc 设计)。

或者

  • 在 fxmlloader 上设置控制器实例,然后要求加载程序 fxmlloader 一个 fxml(没有 load() 属性)。这将初始化在代码中创建的控制器实例。
java速学教程(入门到精通)
java速学教程(入门到精通)

java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

相关专题

更多
php文件怎么打开
php文件怎么打开

打开php文件步骤:1、选择文本编辑器;2、在选择的文本编辑器中,创建一个新的文件,并将其保存为.php文件;3、在创建的PHP文件中,编写PHP代码;4、要在本地计算机上运行PHP文件,需要设置一个服务器环境;5、安装服务器环境后,需要将PHP文件放入服务器目录中;6、一旦将PHP文件放入服务器目录中,就可以通过浏览器来运行它。

2524

2023.09.01

php怎么取出数组的前几个元素
php怎么取出数组的前几个元素

取出php数组的前几个元素的方法有使用array_slice()函数、使用array_splice()函数、使用循环遍历、使用array_slice()函数和array_values()函数等。本专题为大家提供php数组相关的文章、下载、课程内容,供大家免费下载体验。

1600

2023.10.11

php反序列化失败怎么办
php反序列化失败怎么办

php反序列化失败的解决办法检查序列化数据。检查类定义、检查错误日志、更新PHP版本和应用安全措施等。本专题为大家提供php反序列化相关的文章、下载、课程内容,供大家免费下载体验。

1493

2023.10.11

php怎么连接mssql数据库
php怎么连接mssql数据库

连接方法:1、通过mssql_系列函数;2、通过sqlsrv_系列函数;3、通过odbc方式连接;4、通过PDO方式;5、通过COM方式连接。想了解php怎么连接mssql数据库的详细内容,可以访问下面的文章。

952

2023.10.23

php连接mssql数据库的方法
php连接mssql数据库的方法

php连接mssql数据库的方法有使用PHP的MSSQL扩展、使用PDO等。想了解更多php连接mssql数据库相关内容,可以阅读本专题下面的文章。

1416

2023.10.23

html怎么上传
html怎么上传

html通过使用HTML表单、JavaScript和PHP上传。更多关于html的问题详细请看本专题下面的文章。php中文网欢迎大家前来学习。

1234

2023.11.03

PHP出现乱码怎么解决
PHP出现乱码怎么解决

PHP出现乱码可以通过修改PHP文件头部的字符编码设置、检查PHP文件的编码格式、检查数据库连接设置和检查HTML页面的字符编码设置来解决。更多关于php乱码的问题详情请看本专题下面的文章。php中文网欢迎大家前来学习。

1445

2023.11.09

php文件怎么在手机上打开
php文件怎么在手机上打开

php文件在手机上打开需要在手机上搭建一个能够运行php的服务器环境,并将php文件上传到服务器上。再在手机上的浏览器中输入服务器的IP地址或域名,加上php文件的路径,即可打开php文件并查看其内容。更多关于php相关问题,详情请看本专题下面的文章。php中文网欢迎大家前来学习。

1306

2023.11.13

Java 桌面应用开发(JavaFX 实战)
Java 桌面应用开发(JavaFX 实战)

本专题系统讲解 Java 在桌面应用开发领域的实战应用,重点围绕 JavaFX 框架,涵盖界面布局、控件使用、事件处理、FXML、样式美化(CSS)、多线程与UI响应优化,以及桌面应用的打包与发布。通过完整示例项目,帮助学习者掌握 使用 Java 构建现代化、跨平台桌面应用程序的核心能力。

36

2026.01.14

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号