问题描述
我写了下面的代码来显示ipaddress
I''m write following code for displaying ipaddress
import java.net.*;
import java.io.*;
public class ipadd {
public static void main(String [] args) {
try {
InetAddress thisIp =InetAddress.getLocalHost();
System.out.println("IP:"+thisIp.getHostAddress());
}
catch(Exception e) {
e.printStackTrace();
}
}
}
如何将生成的ipaddress更新到mysql数据库中.
如何将数据库从Java连接到数据库.
[edit]已添加代码块,忽略HTML ..."选项已禁用-OriginalGriff [/edit]
how to update the resultant ipaddress into mysql database.
how to connect database from java to database.
[edit]Code block added, "Ignore HTML..." option disabled - OriginalGriff[/edit]
推荐答案
如何将数据库从Java连接到数据库.
how to connect database from java to database.
似乎,真正的问题是-如何在java中使用mySQL数据库.
本文将帮助您了解JDBC.
http://www.vogella.de/articles/MySQLJava/article.html [ ^ ]
Seems like, the real question is - how to use mySQL database with java.
This article will help you understand JDBC.
http://www.vogella.de/articles/MySQLJava/article.html[^]
这篇关于如何在数据库中存储ipaddress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!