首页 \ 问答 \ 将运行在docker容器中的tomcat webapp连接到mysql(connecting tomcat webapp running in docker container to mysql)

将运行在docker容器中的tomcat webapp连接到mysql(connecting tomcat webapp running in docker container to mysql)

我有MySQL服务器在Centos主机中运行,我想在同一主机中的Docker容器内的tomcat中部署我的战争。 任何想法如何从容器内部连接mysql。


I have mysql server running in centos host and I want to deploy my war in tomcat inside docker container in same host. Any idea how can I connect mysql from inside the container.


原文:https://stackoverflow.com/questions/29679661
更新时间:2023-01-01 19:01

相关问答

更多
  • google.com> base64图像解码c#> http://www.eggheadcafe.com/community/aspnet/2/39033/convert-base64-string-to-image.aspx Byte[] bitmapData = Convert.FromBase64String(FixBase64ForImage(ImageText)); System.IO.MemoryStream streamBitmap = new System.IO.MemoryStream(b ...
  • Google是你的朋友 这是从该页面的实现: /* base64.cpp and base64.h Copyright (C) 2004-2008 René Nyffenegger This source code is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising f ...
  • 使用以下方法将位图转换为字节数组: ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream); byte[] byteArray = byteArrayOutputStream .toByteArray(); 从字节数组中使用以下方法对base64进行编码 String ...
  • 您只需使用其他内置方法即可恢复代码。 byte[] decodedString = Base64.decode(encodedImage, Base64.DEFAULT); Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); You can just basically revert your code using some other built in methods. ...
  • 是的,您使用的方法可能是我见过的最受欢迎的方法。 我也需要转换图像,所以我用同样的方法写了一些东西。 然而 ,这对我来说效率太低而且速度太慢。 我决定寻找解决方法。 我发现这个由John Walker编写的小程序叫做base64.exe 。 我在输出上做了一些包装并对输出进行了一些修改。 结果是Base64encoder ,但它是在很久以前编写的。 我在这里上传了源代码: Base64encoder_v2.1-source.zip (在MIT License下发布) 我后来创建了一个可以在这里找到的C库: ...
  • 试试这个位图; public Bitmap convert(String img){ byte[] b = Base64.decode(img, Base64.DEFAULT); return BitmapFactory.decodeByteArray(b, 0, b.length); } 而这就是String public String convert(Bitmap bm, int quality){ ByteArrayOutputStream baos = new By ...
  • GUID中的字节顺序与小端系统上ToString()表示的顺序不同。 你应该使用guid.ToByteArray()而不是使用ToString()。 而且,你应该使用new Guid(byte[] b)来构造它,而不是$str 。 用纯C#表达这一点: public string GuidToBase64(Guid guid) { return System.Convert.ToBase64String(guid.ToByteArray()); // Very similar to what yo ...
  • 我找到了解决方案 - 这里是安装: 使用流式传输的Android文件到Base64有时会错过2个字节 简而言之 - 需要base64OutputStream.close(); 在使用编码的byte[] / String执行更多操作之前 I have found the solution - here is the answear: Android File To Base64 using streaming sometimes missed 2 bytes In short - there is a nee ...
  • 我有一个类似的问题,我想用Android将生成的BASE64字符串转换为Binary,并且atob函数一直给我错误。 我的第一个猜测就像你使用URL_SAFE而不是DEFAULT ,但没有一个工作,然后我发现我需要使用Base64.NO_WRAP方法来使它工作。 我测试了Base64.NO_WRAP并显示内嵌图像和IT工作!!!! 希望这能为你节省一些神经,因为我确实有一些东西,直到我弄清楚如何去做。 所以要给出好的答案,更改: return Base64.encodeToString(bytes, Bas ...
  • 你的代码是不必要的复杂。 这就是你所需要的: {$APPTYPE CONSOLE} uses System.SysUtils, System.Classes, Vcl.Graphics, Soap.EncdDecd; function Base64FromBitmap(Bitmap: TBitmap): string; var Input: TBytesStream; Output: TStringStream; begin Input := TBytesStream.Cre ...

相关文章

更多

最新问答

更多
  • 如何检索Ember.js模型的所有属性(How to retrieve all properties of an Ember.js model)
  • maven中snapshot快照库和release发布库的区别和作用
  • arraylist中的搜索元素(Search element in arraylist)
  • 从mysli_fetch_array中获取选定的值并输出(Get selected value from mysli_fetch_array and output)
  • Windows Phone上的可用共享扩展(Available Share Extensions on Windows Phone)
  • 如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • 从iframe访问父页面的id元素(accessing id element of parent page from iframe)
  • linux的常用命令干什么用的
  • Feign Client + Eureka POST请求正文(Feign Client + Eureka POST request body)
  • 怎么删除禁用RHEL/CentOS 7上不需要的服务
  • 为什么Gradle运行测试两次?(Why does Gradle run tests twice?)
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在android中的活动之间切换?(Switching between activities in android?)
  • Perforce:如何从Depot到Workspace丢失文件?(Perforce: how to get missing file from Depot to Workspace?)
  • Webform页面避免运行服务器(Webform page avoiding runat server)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 内存布局破解(memory layout hack)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • 我们可以有一个调度程序,你可以异步添加东西,但会同步按顺序执行吗?(Can we have a dispatcher that you can add things todo asynchronously but will be executed in that order synchronously?)
  • “FROM a,b”和“FROM a FULL OUTER JOIN b”之间有什么区别?(What is the difference between “FROM a, b” and “FROM a FULL OUTER JOIN b”?)
  • Java中的不可变类(Immutable class in Java)
  • bat批处理文件结果导出到txt
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • 德州新起点计算机培训学校主要课程有什么?
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • “latin1_german1_ci”整理来自哪里?(Where is “latin1_german1_ci” collation coming from?)